예제 #1
0
        public async Task <Models.Muse.Chart> CancelChartChanges(Models.Muse.Chart item)
        {
            var entityToCancel = context.Entry(item);

            entityToCancel.CurrentValues.SetValues(entityToCancel.OriginalValues);
            entityToCancel.State = EntityState.Unchanged;

            return(item);
        }
예제 #2
0
        public async Task <Models.Muse.Chart> CreateChart(Models.Muse.Chart chart)
        {
            OnChartCreated(chart);

            context.Charts.Add(chart);
            context.SaveChanges();

            OnAfterChartCreated(chart);

            return(chart);
        }
예제 #3
0
 partial void OnAfterChartCreated(Models.Muse.Chart item);
예제 #4
0
        public async Task <Models.Muse.Chart> UpdateChart(string nendo, string genre, decimal?hyokaNum, string kyokuName, string authorName, decimal?hour, decimal?minute, decimal?second, decimal?member, decimal?fileSize, Models.Muse.Chart chart)
        {
            OnChartUpdated(chart);

            var itemToUpdate = context.Charts
                               .Where(i => i.NENDO == nendo && i.GENRE == genre && i.HYOKA_NUM == hyokaNum && i.KYOKU_NAME == kyokuName && i.AUTHOR_NAME == authorName && i.HOUR == hour && i.MINUTE == minute && i.SECOND == second && i.MEMBER == member && i.FILE_SIZE == fileSize)
                               .FirstOrDefault();

            if (itemToUpdate == null)
            {
                throw new Exception("Item no longer available");
            }
            var entryToUpdate = context.Entry(itemToUpdate);

            entryToUpdate.CurrentValues.SetValues(chart);
            entryToUpdate.State = EntityState.Modified;
            context.SaveChanges();

            OnAfterChartUpdated(chart);

            return(chart);
        }
예제 #5
0
 partial void OnChartUpdated(Models.Muse.Chart item);
예제 #6
0
 partial void OnChartGet(Models.Muse.Chart item);
예제 #7
0
 partial void OnAfterChartDeleted(Models.Muse.Chart item);