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