using System; using System.Collections.Generic; using System.Linq; using System.Web; using AIAHTML5.ADMIN.API.Entity; namespace AIAHTML5.ADMIN.API.Models { public class EditionModel { public int Id { get; set; } public string Title { get; set; } public int Priority { get; set; } public bool IsActive { get; set; } public static List GetEditions(AIADatabaseV5Entities dbContext) { List EditionList = new List(); EditionModel EditionObj = new EditionModel(); int i = 0; try { var result = dbContext.usp_GetEditions().ToList(); if (result.Count > 0) { foreach (var item in result) { EditionObj = new EditionModel(); EditionObj.Id = item.Id; EditionObj.Title = item.Title; EditionObj.Priority = item.Priority; EditionObj.IsActive = item.IsActive; EditionList.Add(EditionObj); } } } catch (Exception ex) { } return EditionList; } } }