示例#1
0
        public static List <User> GetUsers()
        {
            var context  = new EstateDbContext();
            var userList = context.Users.ToList();

            return(userList);
        }
示例#2
0
        public static List <Report> GetReportsByUserId(Guid userId)
        {
            var context    = new EstateDbContext();
            var reportList = context.Reports.Where(rep => rep.UserId == userId).ToList();

            return(reportList);
        }
示例#3
0
        public static void AddReport(Report newReport)
        {
            var context = new EstateDbContext();

            context.Reports.Add(newReport);

            context.SaveChanges();
        }
示例#4
0
        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);
            }
        }
示例#5
0
 /// <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;
 }
示例#8
0
 /// <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;
 }