public ActionResult Create() { var resourceType = new ResourceType { Name = "new resource type" }; DbUtil.Db.ResourceTypes.InsertOnSubmit(resourceType); DbUtil.Db.SubmitChanges(); return Redirect($"/ResourceTypes/#{resourceType.ResourceTypeId}"); }
public ResourceTypeModel(ResourceType resourceType) { ResourceType = resourceType; Resources = resourceType.Resources .OrderBy(r => r.ResourceCategory.DisplayOrder) .ThenBy(r => r.DisplayOrder); }
public ResourceTypeModel(ResourceType resourceType, IEnumerable<Resource> resources) { ResourceType = resourceType; Resources = resources; }