diff --git a/Extensions/XModelExtensions.cs b/Extensions/XModelExtensions.cs new file mode 100644 index 0000000..3f11a1b --- /dev/null +++ b/Extensions/XModelExtensions.cs @@ -0,0 +1,34 @@ +using xCommons.Extensions; +using xModels.Dtos; + +namespace xModels.Extensions +{ + public static class XModelExtensions + { + /// + /// Check to XDevice instance to be same or not + /// + /// + /// + /// + public static bool IsSameAs(this XDeviceDto source, XDeviceDto dest) + { + // + if (source.IsNull() || + dest.IsNull()) + { + return false; + } + + // + var isSame = source.Os.ToNormalString() == dest.Os.ToNormalString() && + source.OsVersion.ToNormalString() == dest.OsVersion.ToNormalString() && + source.Browser.ToNormalString() == dest.Browser.ToNormalString() && + source.UserAgent.ToNormalString() == dest.UserAgent.ToNormalString() && + source.DeviceType == dest.DeviceType; + + // + return isSame; + } + } +} \ No newline at end of file