public static List <User> GetUsers() { var context = new EstateDbContext(); var userList = context.Users.ToList(); return(userList); }
public static List <Report> GetReportsByUserId(Guid userId) { var context = new EstateDbContext(); var reportList = context.Reports.Where(rep => rep.UserId == userId).ToList(); return(reportList); }
public static void AddReport(Report newReport) { var context = new EstateDbContext(); context.Reports.Add(newReport); context.SaveChanges(); }
public static bool ValidLogin(string username, string password) { var db = new EstateDbContext(); bool isLoginValid = db.Users.Any(p => p.Name == username && p.Password == password); if (isLoginValid) { return(true); } else { return(false); } }
/// <summary> /// Constuctor of the <seealso cref="CommentRepository"/> class. /// </summary> /// <param name="context"></param> public CommentRepository(EstateDbContext context, IMapper mapper) { this.context = context ?? throw new ArgumentNullException(nameof(context)); this.mapper = mapper ?? throw new ArgumentNullException(nameof(mapper)); }
public AddressService(EstateDbContext dbContext) { this.dbContext = dbContext; }
public HouseService(EstateDbContext dbContext) { this.dbContext = dbContext; }
/// <summary> /// Constructor of the <seealso cref="UserRepository"/> class. /// </summary> public UserRepository(EstateDbContext context) { this.context = context ?? throw new ArgumentNullException(nameof(context)); }
public WorkplaceService(EstateDbContext dbContext) { this.dbContext = dbContext; }
public UserService(EstateDbContext dbContext) { this.dbContext = dbContext; }