public LicenseModel GetById(int id) { return(_context.Licenses.Where(x => x.Id == id).Select(x => new LicenseModel { Id = x.Id, IdClient = x.IdClients, ClientName = ClientClass.GetClientName(x.IdClients), IsActive = x.IsActive, Creation = x.Creation, IdApplication = x.IdApplication, PermissionsModel = PermissionClass.ConvertPermission(x.Permissions), Number = x.Number, AssignedVersion = x.AssignedVersion, Inclusion = x.Inclusion, IsActivated = x.IsActivated, IdentityNumber = x.IdentityNumber, Expiration = x.Expiration, ApplicationModel = ApplicationClass.ConvertPermission(x.Application) }).FirstOrDefault()); }
public IEnumerable <LicenseModel> GetLicensesModelByApplication(int idApp) { return(_context.Licenses.Where(x => x.IdApplication == idApp).Select(x => new LicenseModel() { Id = x.Id, IdClient = x.IdClients, ClientName = ClientClass.GetClientName(x.IdClients), IsActive = x.IsActive, Creation = x.Creation, IdApplication = x.IdApplication, PermissionsModel = PermissionClass.ConvertPermission(x.Permissions), Number = x.Number, AssignedVersion = x.AssignedVersion, Inclusion = x.Inclusion, IsActivated = x.IsActivated, IdentityNumber = x.IdentityNumber, Expiration = x.Expiration, ApplicationModel = ApplicationClass.ConvertPermission(x.Application) })); }