• Asp.netCore

    Asp.net core MVC # Sampurna Full MVC

    Hey guys this is not actually a real official post but in this post i will be working on different scenarios that i felt difficult when playing with asp.net core MVC: 1. Adding Cookies : Note: Here Obj is the variable that i got from database. Note: After that we are going to call that cookies so that empid is called at any time any place : 2.Privately getting database content : 3.This is how i actually created a login Account Controller and called my database to give the specified screen when a user as well as admin logs in : 4. Upload File to the server this is a…

  • Xamarin Forms Project Tutorial

    Xamarin Forms picker with entry data uploading it to azure database #18

    Through out my tutorial we have been talking about Model View ViewModel : In this tutorial too we will be talking about MVVM approach so the basic idea is to upload the content of the entry to the azure data base. Step1: Inisde App.xaml.cs Step 2: Views Folder : OrderPage.xaml OrderPage.xaml.cs Step 3: ViewModel Folder : OrderViewModel.cs Step 4: ApiService.cs Step 5 : Models Folder Output : 51 total views, 1 views today

  • Xamarin Forms Project Tutorial

    Question and Answer API in Asp.net core Web Api[Sampurna] #4

    This is a simple api where we are going to display list of answers with respect to the given question : Step1: Models Folder Answer.cs: Question.cs ExamContext.cs Step2: Startup.cs Step-3: Inside Packetmanager console Add-migration initial Update-database Step4: Now it’s time to create api controllers: QuestionController.cs AnswerController.cs Step5: Fill the table with data at first then it’s time to get answers from the given parameters Using get request : http://localhost:49795/api/Answer?question=mexican Select Params Key: question value : mexican now out put: 57 total views, no views today

  • Asp.netCore

    Asp.net core Web API join three tables with Guid [Sampurna]#4

    Hey guys this articles that i am writing is an unofficial articles. If you are not executing then i am not resposible. You have to wait until i make a perfect tutorial on My Xamarin Guy Show. @XamarinGuyShowOfficial At first we are going to create a simple web api project. We are going to join three tables with guid’s and create an API. We will be using Employee,Department&Block classes and Employee class will be our master table class from where we are going to handle department and block. Step1: Lets create models Folder. Which contain class: Department,Employee,Block,EmployeeContext,MyWish Department.cs: Block.cs Employee.cs: EmployeeContext.cs: MyWish.cs Step2: Inside Startup.cs Class configure your database Step3:…

  • Asp.netCore

    Asp.net core Web API join two tables [Sampurna]#3

    Create a model folder(Models) Step1: Inside Models folder Create a Department class Department.cs Step2 : Create a Employee.cs class with in folder Step 3: Create a employee context class inside models folder EmployeeContext //This class will be called inside controller i.e employee controller for our post and put method. Step4 : Create another class NewCollector Step5: Inside our Startup.cs class Step6 : Inside our package manager console Add-migration Initial UpdateDatabase Step7: Create a controllers class replace with this : Step8: Run the application Use this For GEt : http://localhost:49465/api/employees Use this for POST : http://localhost:49465/api/employees and select body >> raw >> json (Application/json)>> and add this Use this for put…

  • Asp.netCore

    Asp.net core Perfect learning tutorial [Sampurna] #2

    Hey guys in this tutorial we are going to create a simple asp.net core web api migrating to data base. and making some crud operation. Create a new project > Asp.netcorewebApp>WebApplication4(Anyname) >SelectApi> At first check your project is running or not. Create a new Folder Naming it as Models>create a class(TicketClass) tep2: Create a TicketContextClass inside model Folder Name it as TicketContext.cs //here DbContext inherits from using Microsoft.EntityFrameworkCore; //This TicketItems will take all the contents from the database so of course we need to tell data base to get connection : so lets go to Startup.cs If you don’t know how to access the GetConnectionString then you can store it…

  • Xamarin Forms Project Tutorial

    Adding Swagger in Asp.net core App [Sampurna #1]

    Configure Swagger in ASP.net Core Web Project App using Swashbuckle.AspNetCore Step1: Install package Swashbuckle.AspNetCore Step2: Configure Swagger middleware : Startup.cs : public void ConfigureServices(IServiceCollection services) { services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); services.AddSwaggerGen(c => { c.SwaggerDoc("v1.0", new Info { Title = "My Demo API", Version = "1.0" }); }); } Inside configure method inside Startup.cs : public void Configure(IApplicationBuilder app, IHostingEnvironment env) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } else { app.UseHsts(); } app.UseHttpsRedirection(); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1.0/swagger.json", "My Demo API (V 1.0)"); }); app.UseMvc(); } 60 total views, no views today