public EditAssignmentDeadlineModel(AssignmentDbContext phd, ProfileDbContext pDb) { assignmentDbContext = phd; newAssignment = new Assignment(); profileDbContext = pDb; CurrentProfile = new Profile(); }
public ViewAssignmentAdminModel(AssignmentDbContext phd, ProfileDbContext pDbContext) { assignmentDbContext = phd; newAssignment = new Assignment(); profileDbContext = pDbContext; CurrentProfile = new Profile(); }
public SubmissionSuccessfulModel(AssignmentDbContext adb, CourseDbContext cdb, IOptions <Assignment> globalAssignment) { assignmentDbContext = adb; courseDbContext = cdb; CurrentCourse = new Course(); GlobalAssignment = globalAssignment.Value; }
//TODO:Remove the constructor after using Ioc and Data referance public TaskService() { AssignmentDbContext context = new AssignmentDbContext(); _taskRepository = new EfRepository <Task>(context); _userTaskRepository = new EfRepository <UserTask>(context); }
public DeleteAssignmentModel(AssignmentDbContext phd, ProfileDbContext pDb) { assignmentDbContext = phd; profileDbContext = pDb; CurrentProfile = new Profile(); newAssignment = new Assignment(); }
public static void MockCustomer(AssignmentDbContext assignmentDbContext) { var customer1 = new Customer() { Name = "Customer1", Email = "*****@*****.**", Phone = 71234568, CreateDate = DateTime.Now, UpdateDate = DateTime.Now }; var customer2 = new Customer() { Name = "Customer2", Email = "*****@*****.**", Phone = 234567189, CreateDate = DateTime.Now, UpdateDate = DateTime.Now }; var customer3 = new Customer() { Name = "Customer3", Email = "*****@*****.**", Phone = 1239874, CreateDate = DateTime.Now, UpdateDate = DateTime.Now }; assignmentDbContext.Add(customer1); assignmentDbContext.Add(customer2); assignmentDbContext.Add(customer3); assignmentDbContext.SaveChanges(); }
public EditAssignmentsPageModel(AssignmentDbContext asd, ProfileDbContext pDb) { assignmentDbContext = asd; OldAssignmentsList = new List <Assignment>(); OngoingAssignmentsList = new List <Assignment>(); profileDbContext = pDb; CurrentProfile = new Profile(); }
//TODO:Remove the constructor after using Ioc and Data referance public UserService() { AssignmentDbContext context = new AssignmentDbContext(); _userRepository = new EfRepository <User>(context); _groupRepository = new EfRepository <Group>(context); _userGroupRepository = new EfRepository <UserGroup>(context);; }
public AssignmentsModel(AssignmentDbContext adb, CourseDbContext cdb) { assignmentDbContext = adb; courseDbContext = cdb; PendingAssignments = new List <Assignment>(); OldAssignments = new List <Assignment>(); CurrentCourse = new Course(); }
public ViewAssignmentModel(AssignmentDbContext adb, CourseDbContext cdb) { assignmentDbContext = adb; courseDbContext = cdb; CurrentAssignment = new Assignment(); CurrentCourse = new Course(); IfDue = false; }
public UploadAssignmentAttachmentPageModel(AssignmentDbContext adb, ProfileDbContext pDbContext) { assignmentDbContext = adb; CurrentAssignment = new Assignment(); CurrentAssignment = adb.Assignments.Last(); profileDbContext = pDbContext; CurrentProfile = new Profile(); }
public SubmitAssignmentModel(SubmissionDbContext sdb, AssignmentDbContext adb, CourseDbContext cdb, IOptions <Assignment> globalAssignment) { submissionDbContext = sdb; assignmentDbContext = adb; courseDbContext = cdb; CurrentCourse = new Course(); CurrentAssignment = new Assignment(); GlobalAssignment = globalAssignment.Value; }
public CourseModel(CourseDbContext cdb, AssignmentDbContext adb, ProfileDbContext pdb) { courseDbContext = cdb; assignmentDbContext = adb; profileDbContext = pdb; CurrentCourse = new Course(); CurrentProfile = new Profile(); AssignmentList = new List <Assignment>(); TAs = new List <string>(); }
public AddNewAssignmentModel(AssignmentDbContext adb, CourseDbContext cdb, ProfileDbContext pdb) { assignmentDbContext = adb; courseDbContext = cdb; CoursesList = new List <Course>(); newAssignment = new Assignment(); profileDbContext = pdb; CurrentProfile = new Profile(); }
public static void SeedHostDb(AssignmentDbContext context) { context.SuppressAutoSetTenantId = true; // Host seed new InitialHostDbBuilder(context).Create(); // Default tenant seed (in host database). new DefaultTenantBuilder(context).Create(); new TenantRoleAndUserBuilder(context, 1).Create(); }
/// <summary> /// IntervalData method returns jsonstring. /// </summary> public string IntervalData() { // Create an DB Context Object AssignmentDbContext dbContext = new AssignmentDbContext(); /* The below Linq code groups the data on TimSlot Hour * and selects the required column data to generate the response object*/ var intervalData = dbContext.IntervalData .AsEnumerable() .GroupBy(row => row.TimeSlot.Hours) .Select(grp => new { TimeSlot = grp.Key, SlotValue = grp.Select(u => u.SlotVal).Sum() / 2, DeliveryPoint = grp.Select(u => u.DeliveryPoint).FirstOrDefault(), Date = grp.Select(u => u.Date).FirstOrDefault(), Id = grp.Select(u => u.Id).FirstOrDefault() }); return(JsonConvert.SerializeObject(intervalData.ToArray())); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); try { var assignmentDbContext = new AssignmentDbContext(GetOptions(Configuration.GetConnectionString("DefaultConnection"))); if (!assignmentDbContext.Database.CanConnect()) { assignmentDbContext.Database.Migrate(); assignmentDbContext.SeedingsData(); } } catch (SqlException) { } } else { // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseMvc(); // Enable middleware to serve generated Swagger as a JSON endpoint. app.UseSwagger(); // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), // specifying the Swagger JSON endpoint. app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "API V1"); }); }
public ProductController() { dbContext = new AssignmentDbContext(); }
public AuthenticationUsersController(AssignmentDbContext context) { _context = context; }
public CourseAssignmentsController(AssignmentDbContext context) { _context = context; }
public AgentController(AssignmentDbContext context, IHostingEnvironment hostingEnvironment, IMapper mapper) { _context = context; _hostingEnvironment = hostingEnvironment; _mapper = mapper; }
public DefaultCowsSensorsCreator(AssignmentDbContext context) { _context = context; }
public DefaultEditionCreator(AssignmentDbContext context) { _context = context; }
public ClassesController(AssignmentDbContext context) { _context = context; }
public HostRoleAndUserCreator(AssignmentDbContext context) { _context = context; }
public DefaultSettingsCreator(AssignmentDbContext context) { _context = context; }
public MarkupPlanController(AssignmentDbContext context) { _context = context; }
public UploadAssignmentModel(SubmissionDbContext sdb, AssignmentDbContext asb, IOptions <Assignment> globalAssignment) { submissionDbContext = sdb; assignmentDbContext = asb; GlobalAssignment = globalAssignment.Value; }
public TenantRoleAndUserBuilder(AssignmentDbContext context, int tenantId) { _context = context; _tenantId = tenantId; }
public UploadAssignmentAttachmentModel(AssignmentDbContext adb) { assignmentDbContext = adb; }