public ActionResult CreateSource(string title, string updated, string description, string authorname, string authoremail, string boundary, string active) { try { var newSource = new PointDataSource() { Title = title, UpdatedOn = DateTime.Parse(updated), Description = description, AuthorName = authorname, AuthorEmail = authoremail, BoundaryPolygon = boundary, Active = bool.Parse(active), CreatedOn = DateTime.UtcNow, UniqueId = Guid.NewGuid().ToString() }; newSource.Save(); } catch (Exception) { return Json("error", JsonRequestBehavior.AllowGet); } return Json("success", JsonRequestBehavior.AllowGet); }
public static void Setup(int testItems) { SetTestRepo(); for(int i=0;i<testItems;i++){ PointDataSource item=new PointDataSource(); _testRepo._items.Add(item); } }
public static void Setup(PointDataSource item) { SetTestRepo(); _testRepo._items.Add(item); }