public static List<string> GetNamesOfSpreadsheetsForUser(AspNetUsers user) { List<string> NamesOfSpreadsheetsList = new List<string>(); NamesOfSpreadsheetsList = spreadsheetsRepository.FindAll(s => s.AdministratorId_Id == user.Id).Select(t => t.Name).ToList(); if(NamesOfSpreadsheetsList != null && NamesOfSpreadsheetsList.Count>0) { return NamesOfSpreadsheetsList; } return null; }
public static List<long> GetIdsOfSpreadsheetsForUser(AspNetUsers user) { List<long> IdsOfSpreadsheetsList = new List<long>(); IdsOfSpreadsheetsList = spreadsheetsRepository.FindAll(s => s.AdministratorId_Id == user.Id).Select(t => t.Id).ToList(); if (IdsOfSpreadsheetsList != null && IdsOfSpreadsheetsList.Count > 0) { return IdsOfSpreadsheetsList; } return null; }
public static List<AspNetUsers> GetAllRedactors(AspNetUsers user) { List<AspNetUsers> Allredactors = new List<AspNetUsers>(); var redactorsListFromTableRedactors = RedactorsRepository.FindAll(r => r.Administrator_Id == user.Id).GroupBy(a => a.UserId_Id).Select(g => g.First()).OrderBy(i => i.UserId_Id).ToList(); if (redactorsListFromTableRedactors != null) { foreach (var redactor in redactorsListFromTableRedactors) { Allredactors.Add(UsersRepository.Find(u => u.Id == redactor.UserId_Id)); } return Allredactors.OrderBy(u => u.Email).ToList(); } else return null; }
partial void DeleteAspNetUsers(AspNetUsers instance);
partial void UpdateAspNetUsers(AspNetUsers instance);
partial void InsertAspNetUsers(AspNetUsers instance);