c# Programming Glossary: httpcontext.current.user.identity.name
Moq: unit testing a method relying on HttpContext http://stackoverflow.com/questions/1214178/moq-unit-testing-a-method-relying-on-httpcontext extract the username from request string sUser HttpContext.Current.User.Identity.Name everything after the domain sUser sUser.Substring sUser.IndexOf..
Return column based on record in FK table http://stackoverflow.com/questions/15536154/return-column-based-on-record-in-fk-table .Where x x.VendorsSelected.Select s s.UserName .Contains HttpContext.Current.User.Identity.Name .OrderBy v v.ProfileID return viewModel c# linq entity framework.. Selected x.VendorsSelected.Select s s.UserName .Contains HttpContext.Current.User.Identity.Name .OrderBy v v.ProfileID return viewModel share improve this..
.NET built-in helper to parse Domain\Username in User.Identity.Name http://stackoverflow.com/questions/349520/net-built-in-helper-to-parse-domain-username-in-user-identity-name Is there any built in utility or helper to parse HttpContext.Current.User.Identity.Name e.g. domain user to get separately domain name if exists and..
Capture username with log4net http://stackoverflow.com/questions/4813242/capture-username-with-log4net null context.User.Identity.IsAuthenticated MDC.Set user HttpContext.Current.User.Identity.Name The code seems ok except for events that have no user context.. null context.User.Identity.IsAuthenticated MDC.Set user HttpContext.Current.User.Identity.Name so often then you might be able to add the username to your.. would configure this in log4net something like this Log HttpContext.Current.User.Identity.Name layout type log4net.Layout.PatternLayout param name ConversionPattern..
Overriding SaveChanges and setting ModifiedDate, but how do I set ModifiedBy? http://stackoverflow.com/questions/7641552/overriding-savechanges-and-setting-modifieddate-but-how-do-i-set-modifiedby code first share improve this question You can use the HttpContext.Current.User.Identity.Name to get the name of the current user. public override int SaveChanges.. DateProvider.GetCurrentDate entry.Entity.ModifiedBy HttpContext.Current.User.Identity.Name return base.SaveChanges Better way to do this would be to use..
|