Posts

Dynamic property with value

public static class PropertyCopier<TParent, TChild> where TParent : class                                             where TChild : class         {             public static void Copy(TParent parent, TChild child,int programID)             {                 //int programID = -1;                 var parentProperties = parent.GetType().GetProperties();                 var childProperties = child.GetType().GetProperties();                 foreach (var parentProperty in parentProperties)                 {                     foreach (var c...

Dynamic Colums And Row Using Jquery

<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"></script>--> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/jquery-ui.js" type="text/javascript"></script> <link href="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.9/themes/blitzer/jquery-ui.css"       rel="stylesheet" type="text/css" /> <table class="dynatable">     <thead>         <tr class="Header">             <th id="AddRowTh"><button class="add">Add Row</button></th>             <th>ID &nbsp;&nbsp;<a href="#" class="RemoveColumn" onclick='remcol(this)'>Remove</a></th>         </tr>     </...

one class property value to another class propety c#

public class PropertyCopier<TParent, TChild> where TParent : class                                             where TChild : class     {         public static void Copy(TParent parent, TChild child)         {             var parentProperties = parent.GetType().GetProperties();             var childProperties = child.GetType().GetProperties();             foreach (var parentProperty in parentProperties)             {                 foreach (var childProperty in childProperties)                 {                     if (parentProperty.Name != "ID" && childPr...

Dynamic row with pass data to controller

View -------------------------------------------------------------------------------------------------------------------------- @model IEnumerable<Insert_Multiple_Rows_EF_MVC.Models.CustomerModel> @using Insert_Multiple_Rows_EF_MVC.Models @{     Layout = null; } <!DOCTYPE html> <html> <head>     <meta name="viewport" content="width=device-width" />     <title>Index</title>     <style type="text/css">         body {             font-family: Arial;             font-size: 10pt;         }         .table {             border: 1px solid #ccc;             border-collapse: collapse;         }             .table th {           ...

Pass user defined table value in store procedure using Entity framework.

public int RequestTypeInsert<T>(int companyId, IEnumerable<T> data)         {             using (CustomerServicesManagementModelContainer context = new CustomerServicesManagementModelContainer())             {                 //// convert source data to DataTable                 DataTable table = data.ToDataTable();                 List<SqlParameter> _sqlParameters = new List<SqlParameter>() {                     new SqlParameter { ParameterName= "@CompanyID",Value=companyId,SqlDbType = SqlDbType.Int },                     new SqlParameter { ParameterName= "@tvpRequestType",Value=table,SqlDbType = SqlDbType.Structured,TypeName="SERTICRequestTypeInsert" }}; ...

Adding ASP.NET MVC5 Identity Authentication to an existing project

https://stackoverflow.com/questions/31960433/adding-asp-net-mvc5-identity-authentication-to-an-existing-project https://code.msdn.microsoft.com/ASPNET-MVC-5-Security-And-44cbdb97 https://www.c-sharpcorner.com/article/create-identity-in-simple-ways-using-asp-net-mvc-5/ https://stackoverflow.com/questions/31960433/adding-asp-net-mvc5-identity-authentication-to-an-existing-project

SECURING WEBAPI USING JSON WEB TOKEN (JWT) IN WEB API C#

Image
ref site :  http://www.decatechlabs.com/secure-webapi-using-jwt Step 1 : Step 2 : Step 3 : Step 4 : Now replace all code with below code using   Microsoft . IdentityModel . Tokens ; using   System ; using   System . Collections . Generic ; using   System . IdentityModel . Tokens ; using   System . IdentityModel . Tokens . Jwt ; using   System . IO ; using   System . Linq ; using   System . Net ; using   System . Net . Http ; using   System . Security . Cryptography . X509Certificates ; using   System . Threading ; using   System . Threading . Tasks ; using   System . Web ; namespace   WEBAPI_JWT_Authentication {      internal   class   TokenValidationHandler   :   DelegatingHandler      {          private   static   bool   TryRetrieveToken ...