Exemple #1
0
        public object UserLogin(string uName, string uPassword)
        {
            WebDBContext db   = new WebDBContext();
            var          user = db.Members.Where(x => x.Name == uName && x.Password == uPassword).FirstOrDefault();

            if (user == null)
            {
                return(Json(new { ret = 0, data = "", msg = "用户名密码错误" }));
            }
            return(GetToken(uName, uPassword));
        }
Exemple #2
0
        public async void GetQuestions_Test()
        {
            var options = new DbContextOptionsBuilder <WebDBContext>()
                          .UseSqlServer(new SqlConnection("Data Source=(localdb)\\MSSQLLocalDB;Initial Catalog=InterviewTaskDB;Integrated Security=True;Connect Timeout=30;Encrypt=False;TrustServerCertificate=False;ApplicationIntent=ReadWrite;MultiSubnetFailover=False"))
                          .Options;

            _context = new WebDBContext(options);
            var controller = new RESTController(null, _context);

            controller.ModelState.AddModelError("Slug", "Required");

            var result = await controller.GetQuestionAsync();

            Assert.NotEmpty(result);
        }
Exemple #3
0
 public EditUserModel(WebDBContext database)
 {
     _database = database;
 }
Exemple #4
0
 public ProfileModel(WebDBContext database)
 {
     _database = database;
 }
Exemple #5
0
 public DataController()
 {
     db = new WebDBContext();
     
     db.Database.Connection.Open(); 
 }
Exemple #6
0
 public PurchasePageModel(WebDBContext database)
 {
     _database = database;
 }
 public RepositoryBase(WebDBContext context)
 {
     _context = context;
 }
 public ProcessoRepository(WebDBContext context) : base(context)
 {
 }
Exemple #9
0
 public GPIOsController(WebDBContext context)
 {
     _context = context;
 }
 public GeralHeaderRepository(WebDBContext context) : base(context)
 {
 }
Exemple #11
0
 public ProductPageModel(WebDBContext database)
 {
     _database = database;
 }
Exemple #12
0
 public QuestionCore(WebDBContext context)
 {
     _context = context;
 }
Exemple #13
0
 public RESTController(ILogger <RESTController> logger, WebDBContext context)
 {
     _logger  = logger;
     _context = context;
 }
 public TipoRepository(WebDBContext context) : base(context)
 {
 }
Exemple #15
0
 public BasketModel(WebDBContext database)
 {
     _database = database;
 }
Exemple #16
0
 public IndexModel(WebDBContext database)
 {
     _database = database;
 }
 public RegistrationModel(WebDBContext database)
 {
     _database = database;
 }
 public DeparaRepository(WebDBContext context) : base(context)
 {
 }
Exemple #19
0
 public GeralDetalheRepository(WebDBContext context) : base(context)
 {
 }
Exemple #20
0
 public ArquivoRepository(WebDBContext context) : base(context)
 {
 }
Exemple #21
0
 public SettingsController(WebDBContext context)
 {
     _context = context;
 }
Exemple #22
0
 public EditProductModel(WebDBContext database)
 {
     _database = database;
 }
Exemple #23
0
 public LoginModel(WebDBContext database)
 {
     _database = database;
 }
 public LayoutRepository(WebDBContext context) : base(context)
 {
 }
Exemple #25
0
 public AnswersCore(WebDBContext context)
 {
     _context = context;
 }
Exemple #26
0
 /// <summary>
 /// Set bindings between db and web
 /// </summary>
 /// <param name="context"></param>
 public ProductRepository(DbContext context)
 {
     _context = (WebDBContext)context;
 }