public static List<Media_Composers> LoadDatedItemsByPage(string status, int startRow, int pageSize, string sortBy, bool sortAscending)
        {
            using (MediaEntities dbContext = new MediaEntities())
            {
                //List<Media_Artists> list = (from p in dbContext.Media_Artists select p).Skip(startRow * pageSize).Take(pageSize).ToList();

                SortData(sortBy, sortAscending);
                //copy to an array
                int count = pageSize;
                _items = GetListByStatus(status);
                if ((_items.Count - startRow) < count) count = _items.Count - startRow;
                Media_Composers[] pagearray = new Media_Composers[count];

                _items.CopyTo(startRow, pagearray, 0, count);
                //then create a list from array
                List<Media_Composers> page = new List<Media_Composers>(pagearray);
                return page;
            }
        }
 /// <summary>
 /// Deprecated Method for adding a new object to the Media_Composers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMedia_Composers(Media_Composers media_Composers)
 {
     base.AddObject("Media_Composers", media_Composers);
 }
 /// <summary>
 /// Create a new Media_Composers object.
 /// </summary>
 /// <param name="composerId">Initial value of the ComposerId property.</param>
 /// <param name="iPLog">Initial value of the IPLog property.</param>
 public static Media_Composers CreateMedia_Composers(global::System.Int32 composerId, global::System.String iPLog)
 {
     Media_Composers media_Composers = new Media_Composers();
     media_Composers.ComposerId = composerId;
     media_Composers.IPLog = iPLog;
     return media_Composers;
 }
        //INSERT- UPDATE - DELETE 
        public int Insert(string UserId, string ComposerName, string FrontImage, string MainImage, string Description, string Status)
        {
            using (MediaEntities dbContext = new MediaEntities())
            {
                string Alias = StringUtils.GenerateFriendlyString(ComposerName);
                dbContext.CommandTimeout = Settings.CommandTimeout;
                System.Nullable<Int32> ListOrder = (from u in dbContext.Media_Composers select u.ListOrder).DefaultIfEmpty(0).Max() + 1;

                Media_Composers composers_obj = new Media_Composers();
                composers_obj.ComposerName = ComposerName;
                composers_obj.Alias = Alias;
                composers_obj.FrontImage = FrontImage;
                composers_obj.MainImage = MainImage;
                composers_obj.Description = Description;
                composers_obj.ListOrder = (ListOrder == null ? 1 : ListOrder);
                composers_obj.IPLog = IP;    
                composers_obj.CreatedOnDate = System.DateTime.Now;
                composers_obj.CreatedByUserId = new Guid(UserId);            
                composers_obj.Status = Status;
                dbContext.AddToMedia_Composers(composers_obj);
                int i  = dbContext.SaveChanges();
                return i;
            }
        }