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