Hi,please someone can give me link to learn about matrix (two dimensional array) in C# with exercises and solution. Thanks in advance.
...My controller:
[Route("api/[controller]")]
[ApiController]
public class CategoriesController : ControllerBase
{
private readonly IUnitOfWork unitOfWork;
public CategoriesController(IUnitOfWork unitOfWork)
{
this.unitOfWork = unitOfWork;
}
[HttpGet]
[Route("TestCategories")]
public ActionResult<IEnumerable<Category>> TestCategories()
{
return unitOfWork.Categories.FindAll().ToList();
}
}
My Startup:
public void ConfigureServices(IServiceCollection services)
{
services.Configure<CookiePolicyOptions>(options =>
{
// This lambda determines whether user consent for non-essential cookies is needed for a given request.
options.CheckConsentNeeded = context => true;
options.MinimumSameSitePolicy = SameSiteMode.None;
});
services.AddDbContext<ClassifiedAdsDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
services.AddScoped<IUnitOfWork, UnitOfWork>();
services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
}
I did break my app so i can understand how the codes work.
As you can see on my controller i used IUnitOfWork (Interface that comes from MyProject.Domain - class library)
Scenario:
...
I am showing some data in modal pop-up using BootStrap .Basically I am using for each loop for displaying Data. So I would like to know, How To apply paging in these scenario using PagedList asp net core mvc or any other plugin in pop-up modal.
thank you
...I have a search form consisting of 5 html selects, on a site which is running Bootstrap 4.1. This does not work on Apple phones, because when the visitor touches the select, the dropdown of options does not appear. This works fine on computers and android devices. Does anyone have a work around?
...I have a string with numbers in it, for example here is the string "121 testing your City", now, I would like to extract only "121" from the string, how can I do that using C#?
...Hi, how can I get the common multiples of all element of array for example I have this array 2 4 3 . And I want to get the common multiples I do this code but not working. Can someone help me please. Thanks.
...I have been searching on it how to switch ORM using repository pattern, and i was not able to find "examples/sample codes" of it so i can study with that.
I believe my search keywords were wrong (ex. How to switch from EF to ADO.NET using Repo pattern and etc), thats why I can not find an article that talks about it.
Lets say we implement repository pattern with Entity Framework.
Is it repo pattern tightly coupled in Entity Framework? or
Do I need to create another Data Access Layer that talks for ADO.NET/or DAPPER/ Nhibernate?(for example)
Thanks in Advance.
...Hello, I have a HTML form inside which there is <input type="file" />
field, and now before posting form to the server side, I need to validate/check if file field is empty or not, I want user to upload atleast one image file in this field, so how I can implement validation message for <input type ="file" /> field in the form using jQuery or javascript code?
Sample HTML Form
...Do i need Service Layer? From my point of view/understanding.
Presentation Layer = UI
Business Logic Layer = Domain/Entities, Interface and (should DTO resides here)?
Data Access Layer = Implementation of Repository Pattern, CRUD.
Service Layer = ???
If the BLL has Domain/Entities? what layer does business validation belongs to?
From what i know and searched. Entites and DTO is plain.
...
Hello, I would like to know how can I convert UTC datetime into local (user's pc) datetime in asp.net MVC razor page using C#?
I thought .ToLocalTime() should work, but I am not getting correct result.
...