public Study Post([FromBody] Study s) { s.Id = _context.Studies.Count() + 1; _context.Studies.Add(s); _context.SaveChanges(); return(s); }
public User Post([FromBody] User s) { s.Id = _context.Users.Count() + 1; _context.Users.Add(s); _context.SaveChanges(); return(s); }
public Company Post([FromBody] Company s) { s.Id = _context.Companies.Count() + 1; _context.Companies.Add(s); _context.SaveChanges(); return(s); }
public CompaniesController(iClinicalContext context) { _context = context; if (_context.Companies.Count() == 0) { _context.Companies.Add(new Company() { Id = 1, CompanyName = "Alternative Studes INC", CompanyUserName = "******", CompanyPassword = "******", Phone = "7145555555", Description = "We are Alternative Studies INC. We collectivley research hundreds on new studies daily. Thank you for your intrest in our Company.", Email = "*****@*****.**", City = "Santa Ana" }); _context.Companies.Add(new Company() { Id = 2, CompanyName = "Nutrition Studes INC", CompanyUserName = "******", CompanyPassword = "******", Phone = "7143333333", Description = "We are Nutri Studies INC. We collectivley research hundreds on new studies daily. Thank you for your intrest in our Company.", Email = "*****@*****.**", City = "Los Angeles" }); _context.Companies.Add(new Company() { Id = 3, CompanyName = "HealthAmerica Studes INC", CompanyUserName = "******", CompanyPassword = "******", Phone = "3234444444", Description = "We are HealthAmerica Studies INC. We collectivley research hundreds on new studies daily. Thank you for your intrest in our Company.", Email = "*****@*****.**", City = "New York" }); _context.SaveChanges(); } }
public UsersController(iClinicalContext context) { _context = context; if (_context.Users.Count() == 0) { _context.Users.Add(new User() { Id = 1, FirstName = "Harry", LastName = "Dude", Age = 34, Email = "*****@*****.**", Password = "******", Gender = "Male", City = "Los Angeles", Blood = false, Cancer = true, Cardiovascular = false, Congenital = false, Ear = false, Eye = false, Infection = false, Inflammatory = false, Injuries = false, MentalHealth = false, Metabolic = false, Musculoskeletal = false, Neurological = true, OralGastro = false, Renal = false, Reproduction = false, Respiratory = true, Skin = false, Stroke = false, Generic = false, Other = "None", IsObese = true, IsSedentary = false, HasPoorDiet = false, IsSmoker = true, IsDrinker = false, HasHighBloodPressure = false, HasHighCholesterol = false, Studies = "" }); _context.Users.Add(new User() { Id = 2, FirstName = "Billy", LastName = "Pruden", Age = 30, Email = "*****@*****.**", Password = "******", Gender = "Male", City = "Texas", Blood = false, Cancer = false, Cardiovascular = false, Congenital = false, Ear = false, Eye = false, Infection = false, Inflammatory = false, Injuries = false, MentalHealth = false, Metabolic = false, Musculoskeletal = false, Neurological = false, OralGastro = false, Renal = false, Reproduction = false, Respiratory = false, Skin = false, Stroke = false, Generic = false, Other = "None", IsObese = false, IsSedentary = false, HasPoorDiet = false, IsSmoker = false, IsDrinker = false, HasHighBloodPressure = false, HasHighCholesterol = false, Studies = "" }); _context.Users.Add(new User() { Id = 3, FirstName = "Taylor", LastName = "Thomas", Age = 28, Email = "*****@*****.**", Password = "******", Gender = "Male", City = "New York", Blood = false, Cancer = false, Cardiovascular = false, Congenital = false, Ear = false, Eye = false, Infection = false, Inflammatory = false, Injuries = false, MentalHealth = false, Metabolic = false, Musculoskeletal = false, Neurological = false, OralGastro = false, Renal = false, Reproduction = false, Respiratory = false, Skin = false, Stroke = false, Generic = false, Other = "None", IsObese = false, IsSedentary = false, HasPoorDiet = false, IsSmoker = false, IsDrinker = false, HasHighBloodPressure = false, HasHighCholesterol = false, Studies = "" }); _context.SaveChanges(); } }