8/30/21

.net core learning

  1. if you are invoking database details usint Repository patter then use AddTransient to dependency injection in start up.cs
  2. user Entity Framework Core Tools for the NuGet Package Manager which

  • Enables these commonly used commands:
    1. Add-Migration
    2. Drop-Database
    3. Get-DbContext
    4. Get-Migration
    5. Remove-Migration
    6. Scaffold-DbContext
    7. Script-Migration
    8. Update-Database

    7/17/20

    if you got error

    More than one DbContext was found. Specify which one to use. Use the '-Context' parameter for PowerShell commands and the '--context' parameter for dotnet commands.

    solution : Add-Migration 'to create database' Initial --context AppIdentityDbContext

    above i specify name of context

    6/20/20

    reset identity

    DBCC CHECKIDENT ('ProductBrands', RESEED, 0);
    DBCC CHECKIDENT ('ProductTypes', RESEED, 0);

    5/31/20

    working docker file

    #See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

    FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
    WORKDIR /app
    EXPOSE 80

    FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
    WORKDIR /src
    COPY ["DockerPractiseCore.csproj", ""]
    RUN dotnet restore "./DockerPractiseCore.csproj"
    COPY . .
    WORKDIR "/src/."
    RUN dotnet build "DockerPractiseCore.csproj" -c Release -o /app/build

    FROM build AS publish
    RUN dotnet publish "DockerPractiseCore.csproj" -c Release -o /app/publish

    FROM base AS final
    WORKDIR /app
    COPY --from=publish /app/publish .
    ENTRYPOINT ["dotnet", "DockerPractiseCore.dll"]

    3/25/20

    intelligent humor of the day.....somewhere i heard


    kevin  asked einstein what do thing about fourth wordwar?
    then einstein said “ I don’t about third but there will not be fouth worth war”
    kevin got frustrated and said I asking third world war then why you are answering about forth world war
    Then I einstein replied there enough material available for destructions of humanity in third world war so there will not be fourth world war  

    3/16/20

    when you are submit your code to git then one can jira tick like [FLEXDEVOPS-90].it be linked on jira and git. thats how git commit linked to jira.
    we can also put link mentioed on jira

    2/13/20

    Gajar ka halwa

    any north Indian can understand or any punjabi can understand how much IT means to us.
    yes i had it in last month when my friend who was going to US just drop by singapore  and brought it for me. I was so happy n mostly satisfied
    this year I told my husband that red garaj ka halwa (which is very popular in north india ) will come to me.


    I realise it's never about the destination; it is about the journey.”

    after so many days i am posting

    I realise it's never about the destination; it is about the journey.”

    10/10/19

    add json output in web api config visual studio 2019

                config.MapHttpAttributeRoutes();
                config.Formatters.Remove(config.Formatters.XmlFormatter);
                config.Routes.MapHttpRoute(
                    name: "DefaultApi",
                    routeTemplate: "api/{controller}/{id}",
                    defaults: new { id = RouteParameter.Optional }
                );