I am learning MVC. I had previously worked on ASP.Net Web Applications(.NET Framework) in which we used webforms, edmx, and ado.net to connect to the database for CRUD operations. But I don't see any edmx option in ASP.Net Core Web App(MVC) .
I want to create a login page . I have the following table and stored procedure in SQL Server -
I have created a model class
I don't know how to access the stored procedure in MVC for the login page.
Also, I have heard that webforms are now obsolete. So, I wanted to learn the new way of doing CRUD operations. Is ASP.Net Web Applications(.NET Framework) with ADO.NET also going to be obsolete?
I want to create a login page . I have the following table and stored procedure in SQL Server -
C#:
create table users(userId int identity(1,1) primary key, username varchar(20), password varchar(20))
C#:
create proc login(
@username varchar(20),
@password varchar(20)
)
as
begin
if exists(select * from users where username = @username and password=@password)
select 'Success' as UserExists
else
select 'Failed' as UserExists
end
I have created a model class
C#:
public class Login
{
[Key]
public int userID { get; set; }
[Required(ErrorMessage = "Username is required")]
public string username { get; set; }
[Required(ErrorMessage = "Password is required")]
public string password { get; set; }
}
I don't know how to access the stored procedure in MVC for the login page.
Also, I have heard that webforms are now obsolete. So, I wanted to learn the new way of doing CRUD operations. Is ASP.Net Web Applications(.NET Framework) with ADO.NET also going to be obsolete?