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)); }
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); }
public EditUserModel(WebDBContext database) { _database = database; }
public ProfileModel(WebDBContext database) { _database = database; }
public DataController() { db = new WebDBContext(); db.Database.Connection.Open(); }
public PurchasePageModel(WebDBContext database) { _database = database; }
public RepositoryBase(WebDBContext context) { _context = context; }
public ProcessoRepository(WebDBContext context) : base(context) { }
public GPIOsController(WebDBContext context) { _context = context; }
public GeralHeaderRepository(WebDBContext context) : base(context) { }
public ProductPageModel(WebDBContext database) { _database = database; }
public QuestionCore(WebDBContext context) { _context = context; }
public RESTController(ILogger <RESTController> logger, WebDBContext context) { _logger = logger; _context = context; }
public TipoRepository(WebDBContext context) : base(context) { }
public BasketModel(WebDBContext database) { _database = database; }
public IndexModel(WebDBContext database) { _database = database; }
public RegistrationModel(WebDBContext database) { _database = database; }
public DeparaRepository(WebDBContext context) : base(context) { }
public GeralDetalheRepository(WebDBContext context) : base(context) { }
public ArquivoRepository(WebDBContext context) : base(context) { }
public SettingsController(WebDBContext context) { _context = context; }
public EditProductModel(WebDBContext database) { _database = database; }
public LoginModel(WebDBContext database) { _database = database; }
public LayoutRepository(WebDBContext context) : base(context) { }
public AnswersCore(WebDBContext context) { _context = context; }
/// <summary> /// Set bindings between db and web /// </summary> /// <param name="context"></param> public ProductRepository(DbContext context) { _context = (WebDBContext)context; }