I need to reset my ID (identity) of my table because each time I make an update, I have to begin my IDs on 1 due to they increase it into more than 60 000 records each time. How can I do this?
using (DailyContext context= DailyContext.Create())
{
//cleaning old prices
foreach (var price in context.Prices)
{
context.DeleteObject(price);
}
context.SaveChanges();
for (int i = 0; i < newElements.Total; i++)
{
var newPrice = new Price()
{
Date = newElements.From.AddDays(i),
PriceFrom = newElements.Price,
TotalNights = newElements.TotalNights,
Profit = newElements.Profit
};
context.AddToPrices(newPrice);
}
context.SaveChanges();
}