Beispiel #1
0
        public async Task UpdateAsync(EmployeeClassification classification)
        {
            using (var context = new OrmCookbook())
            {
                var temp = await context.EmployeeClassifications.FindAsync(classification.EmployeeClassificationKey);

                temp.EmployeeClassificationName = classification.EmployeeClassificationName;
                await context.SaveChangesAsync();
            }
        }
Beispiel #2
0
        public async Task <int> CreateAsync(EmployeeClassification classification)
        {
            using (var context = new OrmCookbook())
            {
                context.EmployeeClassifications.Add(classification);
                await context.SaveChangesAsync();

                return(classification.EmployeeClassificationKey);
            }
        }
Beispiel #3
0
        public async Task DeleteAsync(EmployeeClassification classification)
        {
            using (var context = new OrmCookbook())
            {
                var temp = await context.EmployeeClassifications.FindAsync(classification.EmployeeClassificationKey);

                if (temp != null)
                {
                    context.EmployeeClassifications.Remove(temp);
                    await context.SaveChangesAsync();
                }
            }
        }