i added UserClaimsPrincipalFactory.cs page
public override async Task<ClaimsPrincipal> CreateAsync(User user)
{
var claim = await base.CreateAsync(user);
claim.Identities.First().AddClaim(new Claim("EmailAddress", user.EmailAddress));
return claim;
}
then Application.core page
public ASAPSessions11(
IPrincipalAccessor principalAccessor,
IMultiTenancyConfig multiTenancy,
ITenantResolver tenantResolver,
IAmbientScopeProvider<SessionOverride> sessionOverrideScopeProvider) :
base(principalAccessor, multiTenancy, tenantResolver, sessionOverrideScopeProvider)
{
}
public string EmailAddress
{
get
{
var userEmailClaim = PrincipalAccessor.Principal?.Claims.FirstOrDefault(c => c.Type == "EmailAddress");
if (string.IsNullOrEmpty(userEmailClaim?.Value))
{
return null;
}
return userEmailClaim.Value;
}
}
how to get EmailAddress value project.Applictaion page
I am loading multiple p-table in a form using LazyLoadEvent. First table loading Actions and second table loading sections. For example first table has no data and second table has data. It will load the empty rows in first table. The datas are not loaded properly too. I think, one LazyLoadEvent is loaded but other one loaded early. So the tables data is loading based on loaded LazyLoadEvent.
getActions(event?: LazyLoadEvent) {
this._activatedRoute.params.subscribe((params: Params) => {
if (params['id'] != '0') {
this._scriptService.getScriptsForEdit(params['id']).subscribe((result) => {
this.filter = result.reC_ID;
this.primengTableHelper.showLoadingIndicator();
if (this.primengTableHelper.shouldResetPaging(event)) {
this.paginator.changePage(0);
return;
}
this._actionService.getActions(
this.filter,
this.primengTableHelper.getSorting(this.dataTable),
this.primengTableHelper.getMaxResultCount(this.paginator, event),
this.primengTableHelper.getSkipCount(this.paginator, event)
).pipe(finalize(() => this.primengTableHelper.hideLoadingIndicator())).subscribe(result => {
this.primengTableHelper.totalRecordsCount = result.totalCount;
this.primengTableHelper.records = result.items;
this.primengTableHelper.hideLoadingIndicator();
});
});
}
});
}
getSections(event?: LazyLoadEvent) {
this._activatedRoute.params.subscribe((params: Params) => {
if (params['id'] != 'new')
{
this._tabService.getTabForEdit(params['id']).subscribe((result) => {
this.filter = result.reC_ID.toString().trim();
this.primengTableHelper.showLoadingIndicator();
if (this.primengTableHelper.shouldResetPaging(event)) {
this.paginator.changePage(0);
return;
}
this._sectionService.getSections(
this.filter,
this.primengTableHelper.getSorting(this.dataTable),
this.primengTableHelper.getMaxResultCount(this.paginator, event),
this.primengTableHelper.getSkipCount(this.paginator, event)
).pipe(finalize(() => this.primengTableHelper.hideLoadingIndicator())).subscribe(result => {
this.primengTableHelper.totalRecordsCount = result.totalCount;
this.primengTableHelper.records = result.items;
this.primengTableHelper.hideLoadingIndicator();
});
});
}
});
}
I have a scenario like below:
There is an one to many relationship with ObjectTable and FieldTable. When i edit the ObjectTable form, i can get the ObjectTable record. But i would like to get FieldTable records also. But it would be return the FieldTable records as PagedResultDto.
Anyone could help me to write the application-service for this scenario. Give me some example also.
Note: I am using ASP.NET Zero and Angular.
Getting the below error while running the npm start command.
Cannot find module 'acorn-dynamic-import'
Error: Cannot find module 'acorn-dynamic-import'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
at Function.Module._load (internal/modules/cjs/loader.js:507:25)
at Module.require (internal/modules/cjs/loader.js:637:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (D:\PROJECT\Project_11022019\src\Project.Web.Host\node_modules\webpack\lib\Parser.js:9:15)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `ng serve --host 0.0.0.0 --port 4200`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
UpdateAsync(obj)
Hi , I have an entity called ASAPSCRIPTS and column REC_ID as string type created as Primary Key. when I call service it throws IRepository<ASAPSCRIPTS> not registered.
Getting this issue after we deployed in azure and execute the functionality. It is working in local system but not in azure. Log is below:
System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() at ASAP.ASAPModules.ASAPModulesAppService.Execute(ASAPModulesApplicationEditDto input) in D:\AzureSolution\ASAP_11022019\src\ASAP.Application\ASAPModules\ASAPModulesAppService.cs:line 336 at lambda_method(Closure , Object , Object[] ) at Microsoft.Extensions.Internal.ObjectMethodExecutor.<>c__DisplayClass33_0.<WrapVoidMethod>b__0(Object target, Object[] parameters) at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters) at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.VoidResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeActionMethodAsync() at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.InvokeNextActionFilterAsync()
The line of the code where error is occured.
HttpWebRequest request = CreateWebRequest();
XmlDocument soapEnvelopeXml = new XmlDocument();
soapEnvelopeXml.LoadXml(@"<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:web='http://webcominc.com/'>
After migration, update-databse -verbose throwing the below error
To change the IDENTITY property of a column, the column needs to be dropped and recreated.
[Table("MMTABS")]
public class ASAPTabsEntity : FullAuditedEntity
{
[ForeignKey("Id")]
public virtual ASAPModulesEntity ASAPModulesEntities { get; set; }
public virtual int? PARENT_MODULE_ID { get; set; }
}
[Table("MMMODL")]
public class ASAPModulesEntity : FullAuditedEntity
{
public virtual ICollection<ASAPTabsEntity> ASAPTabsEntities { get; set; }
}
here, [ForeignKey("Id")] it is not the PK of the MMTABS table, as it is PK of the MMMODL table trying to create one to many relationship with MMMODL and MMTABS
hence I have written the above