.NET Core Beginner Tutorial - Making a Blog Episode 5 - Repository

preview_player
Показать описание
In this episode we are going to abstract our database calls in a repository.

#aspnetcore #csharp
Рекомендации по теме
Комментарии
Автор

Hey buddy, 5:30 how do you rename all types at once?

Frazful
Автор

Anton, not to get off subject but with all the new stuff that is bundled in Net5 are you planning on going over all of it?

Gray-Wolf-Media
Автор

Hi, thank you for the tutorials. Do we need to create separate Repository and interface for every Entity in the Database? Since this deals with posts/blogs only, if we have to add Contact us then do we implement it in the same Repository or create separate for each.

Deeyyo
Автор

Where i can found the shortcuts for visual studio?

kbra
Автор

adding entity framework makes it a little harder to follow, but somehow my app still works even though some small changes to .net core has been made since this was uploaded. great video

Dshan
Автор

Hello Anton, great tutorial, as always...could you please make one video on pros and cons repository pattern...I found many blogs, tutorials etc where they say that repository pattern is now become antipattern, that making repository is actually abstraction of abstraction, especially with EF Core, but in my very humble experience I see it's not quite the case...I see it in this way, if we tomorrow want to migrate to something else that is not EF, we would have to recompile all classes where we use db context, while with repository, we would have to do that only with one class, only with repository (maybe there are many other reasons, but as I said that's my opinion from very very humble experience)....also why is more bad to make generic repository (something like Repository<TEntity>)....I was working a little with .NET Web API where we used unit of work pattern, where's that gone now, is it implemented in EF Core now?

kezara
Автор

Hi! All from my code is correct, but the Title from Edit doesn't appear in Home or in dbo.Posts, just Id, and i don't realise where is the problem.

adrianapaun
Автор

Sir can I ask you something if you have time?
My AppDbContext is
public class AppDbContext: IdentityDbContext<AppUser, AppRole, string>
{
public x) : base(x)
{
}

and my BaseRepository is
public class BaseRepository<T, TContext> : IBaseRepository<T> where T : class, new()
where TContext : DbContext, new()
{
protected TContext context;
public BaseRepository(TContext _context)
{
context = _context;
}

But when I want to create CategoryService and inherit BaseRepository . It warns me . Says something about TContext and parameter.
CategoryService
public class CategoryService : BaseRepository<Category, AppDbContext>, ICategoryService
{
public CategoryService(AppDbContext prm) : base(prm)
{
}
Thank you I appreciate it.

onemorestory
Автор

Hi, for some reason when I run it a window pops up and says ".NET Core Host has stopped working. What might be the problem. Am using Internet Explorer not Chrome

thankgodezeoffor
Автор

Beginning 3:44 explanation stopped. This tutorial isn't beginner friendly for lack of explanation.
Examples:
- which key strokes you did to implement the functionality for the functions at 3:44..
- what did you mean by those methods don't do anything to the database but create at track of changes..
- a lot more questions which aren't addressed....
Sorry if i mentioned this, just a positive feedback.

jr