public IHttpActionResult Get(int id) { GigService gigService = CreateGigService(); var gig = gigService.GetGig(id); return(Ok(gig)); }
private GigService CreateGigService() { var userId = Guid.Parse(User.Identity.GetUserId()); var service = new GigService(userId); return(service); }
private GigService CreateGigService() { var userId = User.Identity.GetUserId(); var gigService = new GigService(userId); return(gigService); }
// GET: api/Gigs // TODO: make async public IHttpActionResult GetGigs() { var gigService = new GigService(); var gigs = gigService.GetGigs(); return(Ok(gigs)); }
// GET: Artist public ActionResult Index() { var userId = Guid.Parse(User.Identity.GetUserId()); var service = new GigService(userId); var model = service.GetGigsByUser(); return(View(model)); }
public IHttpActionResult DeleteGig(int id) { var gigService = new GigService(); if (!gigService.DeleteGig(id)) { return(InternalServerError()); } return(Ok()); }
public IHttpActionResult GetGig(int id) { var gigService = new GigService(); var gig = gigService.GetGigById(id); if (gig == null) { return(NotFound()); } return(Ok(gig)); }
public void CreateServiceStepTwoTest1() { GigService gigService = new GigService(dbContext); Package package = new Package(); package.Name = "Basic"; package.Description = "Description"; package.Title = "Khong co kho"; package.DeliveryTime = 1; package.NumberRevision = 1; package.Price = 50; package.ServiceId = 1; Assert.True(gigService.CreateServiceStepTwo(package)); }
public IHttpActionResult PostGig(GigResource gig) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var gigService = new GigService(); if (!gigService.CreateGig(gig)) { return(InternalServerError()); } return(Ok()); }
protected void PbpDataSource_ObjectCreating(object sender, ObjectDataSourceEventArgs e) { /* Get the Service */ IUnityContainer container = (IUnityContainer) HttpContext.Current.Application["unityContainer"]; // gigService is not resolved against the container because it // produce a proxy that it not available for databinding IGigService gigService = new GigService(); gigService = (IGigService) container.BuildUp(gigService.GetType(), gigService); e.ObjectInstance = gigService; }
public IHttpActionResult PutGig(int id, GigUpdateResource gig) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var gigService = new GigService(); if (!gigService.UpdateGig(id, gig)) { return(InternalServerError()); } return(Ok()); }
public void CreateServiceStepOneTest1(string title, string category, string subcategory, string tags, int sellerId) { GigService gigService = new GigService(dbContext); Assert.NotNull(gigService.CreateServiceStepOne(title, category, subcategory, tags, sellerId)); }
public void GetPackageByPackageIDTest1(int?packageId) { GigService gigService = new GigService(dbContext); Assert.Null(gigService.GetPackageByPackageID(packageId)); }
public void GetListServiceTest1() { GigService gigService = new GigService(dbContext); Assert.Empty(gigService.GetListService()); }
public void GetPackageByServiceIDTest1(int?ServiceId) { GigService gigService = new GigService(dbContext); Assert.Empty(gigService.GetPackageByServiceID(ServiceId)); }
public void GetServiceByIDTest2(int?ID) { GigService gigService = new GigService(dbContext); Assert.Null(gigService.GetServiceByID(ID)); }
public void reportGigTest1() { GigService gigService = new GigService(dbContext); Assert.True(gigService.reportGig(1, 1, "dung de zai", "dung dep zai")); }
public void CreateServiceStepThreeTest1() { GigService gigService = new GigService(dbContext); Assert.True(gigService.CreateServiceStepThree(1, "Dung dep zai", null, null)); }
public void GetUserByServiceIdTest1(int ServiceId) { GigService gigService = new GigService(dbContext); Assert.Null(gigService.GetUserByServiceId(ServiceId)); }