using System.Linq; using xModels.Dtos; using xCommons.Extensions; using System.Collections.Generic; 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; } public static IEnumerable AsEnumerable( this IEnumerable> source ) { return source.Select(i => i.Item); } public static string GetFullname(this XPersonDto source) { // var result = string.Empty; // if (!source.IsNullOrDefault()) { result = $"{source.Firstname} {source.Lastname}"; } // return result; } } }