Exemplo n.º 1
0
        public async void SaveAsync <T>(T a) where T : class
        {
            if (typeof(T) == typeof(Models.Backlog))
            {
                Backlog.Add(a as Models.Backlog);
                await SaveChangesAsync();
            }
            else if (typeof(T) == typeof(Models.Project))
            {
                Project.Add(a as Models.Project);
                await SaveChangesAsync();
            }
            else if (typeof(T) == typeof(Models.Sprint))
            {
                Sprint.Add(a as Models.Sprint);
                await SaveChangesAsync();
            }

            else if (typeof(T) == typeof(Models.Step))
            {
                Step.Add(a as Models.Step);
                await SaveChangesAsync();
            }
            else if (typeof(T) == typeof(Models.Task))
            {
                Task.Add(a as Models.Task);
                await SaveChangesAsync();
            }
            else if (typeof(T) == typeof(Models.User))
            {
                User.Add(a as Models.User);
                await SaveChangesAsync();
            }
        }