Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

How to solve the overwrite the application variable content in .cs file in asp.net?

$
0
0
When i accessing application variable in .cs file and assign that application variable to do class like EmployeeDO.cs after the modifying some values in that do.but it effects the  application variable.
How to rectify my problem with out effecting the application variable.

classs EmployeeDO
{
  public int empno{get;set;}
  public string ename{get;set;}
  public int sal{get;set;}
  public string desgnation{get;set;}
}

Getting the Employeee information in Application["Information"] application variable
In .cs calss

EmployeeDO emp = (EmployeeDO)HttpContext.Current.Application["Information"];

emp.Select(p=>p).Where(l=>l.empno == 100).ToList();

it filters to one record
I want to append some test to the employee designation depends upon the employee type
by calling another function and it returns string value.

emp.ForEach(x=>x.designation += CommonFunctions.getAppendDesignation(101));

In the above program every time it added the same text again and again to the designation when i call the above program.it doesn't replace old added content.

Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>