imp links


[10/01, 8:14 pm] Rajesh: https://www.c-sharpcorner.com/article/asp-net-core-5-0-web-api/

[10/01, 8:23 pm] Rajesh: https://stackoverflow.com/questions/41329108/asp-net-core-get-json-array-using-iconfiguration

[10/01, 8:37 pm] Rajesh: https://www.codegrepper.com/code-examples/csharp/add+object+to+list+c%23

angular curd

----------------


 https://www.google.com/amp/s/www.syncfusion.com/blogs/post/build-crud-application-with-asp-net-core-entity-framework-visual-studio-2019.aspx

https://csharp-video-tutorials.blogspot.com/2019/01/aspnet-core-tutorial-for-beginners.html

https://www.c-sharpcorner.com/article/enabling-cors-in-asp-net-core-api-application/

https://stackoverflow.com/questions/44230580/generating-and-accessing-stored-procedures-using-entity-framework-core

 https://morioh.com/p/eb59620c0e80


ado.net

---------

ado.net : https://www.c-sharpcorner.com/UploadFile/ajyadav123/ado-net-architecture/

https://docs.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqldataadapter.insertcommand?view=dotnet-plat-ext-6.0

https://www.c-sharpcorner.com/article/crud-operations-using-asp-net-core-and-ado-net/

https://www.w3schools.com/sql/sql_stored_procedures.asp



oops

-------

oops: https://www.c-sharpcorner.com/UploadFile/mkagrahari/introduction-to-object-oriented-programming-concepts-in-C-Sharp/

 abstract class& method-     https://www.c-sharpcorner.com/UploadFile/93126e/importance-and-use-of-versioning-in-C-Sharp/

  polymerphism extra -    https://www.c-sharpcorner.com/UploadFile/ff2f08/understanding-polymorphism-in-C-Sharp/

interface -https://www.w3schools.com/cs/cs_interface.php

multiple inheritence -https://www.geeksforgeeks.org/c-sharp-multiple-inheritance-using-interfaces/






interceptor

-----------

https://www.google.com/amp/s/www.digitalocean.com/community/tutorials/how-to-use-angular-interceptors-to-manage-http-requests-and-error-handling.amp


validations

----------

https://stackblitz.com/edit/angular-6-reactive-form-validation-touched?file=app%2Fapp.component.html




angular

-------- environment

https://jasonwatmore.com/post/2020/09/01/angular-master-details-crud-example



/user/:id

by writing


[routerLink]="['/user', user.id]"


Scaffold-DbContext "Data Source=RAJESH-PC\SQLEXPRESS;Initial Catalog=schoolDatabase;Integrated Security=True" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models



<---

5) npm install bootstrap jquery popper.js --S     in angular application and added in angular.json

https://www.itsolutionstuff.com/post/how-to-add-bootstrap-5-in-angular-12example.html

-->


6) auth & jwt  related

https://dotnetcorecentral.com/blog/authentication-handler-in-asp-net-core/

api-https://jasonwatmore.com/post/2021/04/30/net-5-jwt-authentication-tutorial-with-example-api



https://youtu.be/6umBWrG2uqY

https://youtu.be/NSQHiIAP7Z8

https://youtu.be/6umBWrG2uqY


https://www.geekstrick.com/angular-10-secure-routes-using-authguard-based-on-user-role/

https://jasonwatmore.com/post/2018/11/22/angular-7-role-based-authorization-tutorial-with-example#app-routing-ts


7)interceptor related

https://www.digitalocean.com/community/tutorials/how-to-use-angular-interceptors-to-manage-http-requests-and-error-handling.amp


8)validations

https://jasonwatmore.com/post/2018/05/10/angular-6-reactive-forms-validation-example

https://www.positronx.io/angular-url-validation-with-reactive-forms-tutorial/

https://www.itsolutionstuff.com/post/angular-13-reactive-forms-validation-tutorial-exampleexample.html


9)cors cross orign resource sharing

 https://www.c-sharpcorner.com/article/enable-cors-consume-web-api-by-mvc-in-net-core-4/




10)execute sql views 

https://stackoverflow.com/questions/36012616/working-with-sql-views-in-entity-framework-core


11)angular dynamic columns

https://stackblitz.com/edit/full-angular-reactive-forms-demo-h9xtgn?file=src%2Fapp%2Fapp.component.ts




using System;

using System.Collections.Generic;

using System.Linq;

using System.Threading.Tasks;

using Microsoft.AspNetCore.Http;

using Microsoft.AspNetCore.Mvc;

using Microsoft.EntityFrameworkCore;

using AngularCustomerpoc.Models;


namespace AngularCustomerpoc.Controllers

{

    [Route("api/Customer")]

    [ApiController]

    public class TblcustomersController : ControllerBase

    {

        private readonly CustomerContext _context;


        public TblcustomersController(CustomerContext context)

        {

            _context = context;

        }


        // GET: api/Tblcustomers

        //[HttpGet]

        [HttpGet]

        [Route("CustomerDetails")]

        public async Task<ActionResult<IEnumerable<Tblcustomer>>> GetTblcustomers()

        {

            // return await _context.Tblcustomers.ToListAsync();




            return await _context.Tblcustomertest.FromSqlRaw("EXEC SelectAllCustomers ").ToListAsync();



        }


        // GET: api/Tblcustomers/5

        //[HttpGet("{id}")]


        [HttpGet]  

        [Route("CustomerDetailsById/{id}")]

        public async Task<ActionResult<Tblcustomer>> GetTblcustomer(string id)

        {


            //var tblcustomer = await _context.Tblcustomers.FindAsync(id);

            var Tblcustomers = await _context.Tblcustomertest.FromSqlRaw("EXEC [dbo].[Getbyid] {0}", id).ToListAsync();




            //if (tblcustomer == null)

            //{

            //    return NotFound();

            //}


            return Ok(Tblcustomers[0]);

            //return Ok(tblcustomer);

        }


        // PUT: api/Tblcustomers/5

        // To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754

        //[HttpPut("{id}")]


        [HttpPut]

        [Route("UpdateCustomerDetails/{id}")]

        public async Task<IActionResult> PutTblcustomer(string id, Tblcustomer tblcustomer)

        {

            if (id != tblcustomer.CustomerId)

            {

                return BadRequest();

            }


            _context.Entry(tblcustomer).State = EntityState.Modified;


            try

            {

                await _context.SaveChangesAsync();

            }

            catch (DbUpdateConcurrencyException)

            {

                if (!TblcustomerExists(id))

                {

                    return NotFound();

                }

                else

                {

                    throw;

                }

            }


            return NoContent();

        }


        // POST: api/Tblcustomers

        // To protect from overposting attacks, see https://go.microsoft.com/fwlink/?linkid=2123754

        //[HttpPost]

        [HttpPost]

        [Route("InsertCustomerDetails")]

        public async Task<ActionResult<Tblcustomer>> PostTblcustomer(Tblcustomer tblcustomer)

        {


            //var tblcustomers = await _context.Tblcustomers.FindAsync(tblcustomer.CustomerId);


            //if (tblcustomers != null)

            //{

            //    return tblcustomers;

            //}


            _context.Tblcustomers.Add(tblcustomer);

            try

            {

                await _context.SaveChangesAsync();

            }

            catch (DbUpdateException)

            {

                if (TblcustomerExists(tblcustomer.CustomerId))

                {

                    return Conflict();

                }

                else

                {

                    throw;

                }

            }


            return CreatedAtAction("GetTblcustomer", new { id = tblcustomer.CustomerId }, tblcustomer);

        }


        // DELETE: api/Tblcustomers/5

        //[HttpDelete("{id}")]

        [HttpDelete]

        //[Route("DeleteEmployeeDetails")]

        [Route("DeletCustomer")]

        public async Task<IActionResult> DeleteTblcustomer(string id)

        {

            var tblcustomer = await _context.Tblcustomers.FindAsync(id);

            if (tblcustomer == null)

            {

                return NotFound();

            }


            _context.Tblcustomers.Remove(tblcustomer);

            await _context.SaveChangesAsync();


            return NoContent();

        }


        private bool TblcustomerExists(string id)

        {

            return _context.Tblcustomers.Any(e => e.CustomerId == id);

        }

    }

}








Comments