Это мой файл ClassRepository Class
namespace AutoBuggi.Repository
{
public class CategoryRepository
{
//private object dbCategory;
public Guid SaveCategory(Models.CarCategory model)
{
try
{
using (var dbcontext = new AutoBuggiEntities())
{
var dbCategory = new Models.CarCategory()
{
Id = Guid.NewGuid(),
CategoryId = model.CategoryId,
VariantName = model.VariantName
};
dbcontext.CarCategories.Add(dbCategory);
dbcontext.SaveChanges();
}
}
catch(Exception)
{
}
return Guid.Empty;
}
}
}