Hi there, how do I seed data like countries?
This is a feature request if it applies: Actually Power Tools allows you to:
My question is it possible to automate just:
for an existing model using Power Tool?
Hi, I have these entities: namespace DocuPro.DocumentBase { [Table("DocumentVersions")] [Audited] public class DocumentVersion : Entity, IMayHaveTenant { public int? TenantId { get; set; }
public virtual int? DocumentId { get; set; }
[ForeignKey("DocumentId")]
public Document DocumentFk { get; set; }
public virtual ICollection<DocumentVersionFile> DocumentVersionFiles { get; set; }
}
} namespace DocuPro.DocumentBase { [Table("DocumentVersionFiles")] [Audited] public class DocumentVersionFile : Entity, IMayHaveTenant { public int? TenantId { get; set; }
public virtual string OCR { get; set; }
public virtual string FileName { get; set; }
public virtual int? DocumentVersionId { get; set; }
[ForeignKey("DocumentVersionId")]
public DocumentVersion DocumentVersionFk { get; set; }
public virtual int? FileTypeId { get; set; }
[ForeignKey("FileTypeId")]
public FileType FileTypeFk { get; set; }
}
} namespace DocuPro.DocumentBase { [Table("FileTypes")] public class FileType : Entity {
[Required]
public virtual string Extension { get; set; }
}
}
I have this DTO: namespace DocuPro.DocumentBase.Dtos { public class GetDocumentVersionForViewDto { public DocumentVersionDto DocumentVersion { get; set; }
public string DocumentLibelle { get; set; }
}
}
In my service I have this method:
public virtual async Task<List<GetDocumentVersionForViewDto>> GetAllDocumentVersion(int documentId) { // Fetching all DocumentVersions (and associated DocumentVersionFiles) for a specific documentId var documentVersions = await _documentVersionRepository.GetAllIncluding(dv => dv.DocumentVersionFiles) .Where(dv => dv.DocumentId == documentId) .ToListAsync();
// Mapping to DTO
var documentVersionDtos = ObjectMapper.Map<List<GetDocumentVersionForViewDto>>(documentVersions);
return documentVersionDtos;
}
I get this error: XHRGET https://localhost:44302/App/DocumentTabs/TabViewInfomations?documentId=8 [HTTP/2 500 Internal Server Error 250ms]
AutoMapper.AutoMapperMappingException: Error mapping types.
Mapping types:
List1 -> List
1
System.Collections.Generic.List1[[DocuPro.DocumentBase.DocumentVersion, DocuPro.Core, Version=12.3.0.0, Culture=neutral, PublicKeyToken=null]] -> System.Collections.Generic.List
1[[DocuPro.DocumentBase.Dtos.GetDocumentVersionForViewDto, DocuPro.Application.Shared, Version=12.3.0.0, Culture=neutral, PublicKeyToken=null]]
---> AutoMapper.AutoMapperMappingException: Missing type map configuration or unsupported mapping.
Mapping types: DocumentVersion -> GetDocumentVersionForViewDto DocuPro.DocumentBase.DocumentVersion -> DocuPro.DocumentBase.Dtos.GetDocumentVersionForViewDto at lambda_method3201(Closure, DocumentVersion, GetDocumentVersionForViewDto, ResolutionContext) at lambda_method3200(Closure, Object, List`1, ResolutionContext)
--- End of inner exception stack trace ---
at lambda_method3200(Closure, Object, List1, ResolutionContext) at Abp.AutoMapper.AutoMapperObjectMapper.Map[TDestination](Object source) at DocuPro.DocumentBase.DocumentVersionsAppService.GetAllDocumentVersion(Int32 documentId) in C:\Users\hp\OneDrive\APPS\DocuProV10\src\DocuPro.Application\DocumentBase\DocumentVersionsAppService.cs:line 43 at Abp.Authorization.AuthorizationInterceptor.InternalInterceptAsynchronous[TResult](IInvocation invocation) at DocuPro.Web.Areas.App.Controllers.Documents.DocumentTabsController.TabViewInfomations(Nullable
1 state, Int32 documentId) in C:\Users\hp\OneDrive\APPS\DocuProV10\src\DocuPro.Web.Mvc\Areas\App\Controllers\Documents\DocumentTabsController.cs:line 84
at lambda_method3030(Closure, Object)
Yes, that did it. Thanks
I have created the following entity using Power Tools And in my controller I have the code below to insert . However after the await _documentRepository.InsertAsync(document) is executed, the data is not persisted right away. It is posted only when the method has done executing. But I need to get the id of the document
[Table("Documents")] [Audited] public class Document : Entity, IMayHaveTenant { public int? TenantId { get; set; }
[Required]
[StringLength(DocumentConsts.MaxLibelleLength, MinimumLength = DocumentConsts.MinLibelleLength)]
public virtual string Libelle { get; set; }
public virtual DateTime DateDocument { get; set; }
public virtual int DocumentTypeId { get; set; }
[ForeignKey("DocumentTypeId")]
public DocumentType DocumentTypeFk { get; set; }
public virtual int? DocumentCategoryId { get; set; }
[ForeignKey("DocumentCategoryId")]
public DocumentCategory DocumentCategoryFk { get; set; }
}
[HttpPost] public async Task<IActionResult> Index(int Id) { // Get the Document Libelle from the request form string Libelle = Request.Form["Libelle"]; DateTime DateDocument = Convert.ToDateTime(Request.Form["DateDocument"]); int DocumentCategoryId = Convert.ToInt32(Request.Form["DocumentCategoryId"]); int DocumentTypeId = Convert.ToInt32(Request.Form["DocumentTypeId"]);
// Get the file
var file = Request.Form.Files.FirstOrDefault();
// Create the Document
var createDocumentDto = new CreateOrEditDocumentDto
{
Libelle = Libelle,
DateDocument = DateDocument,
DocumentCategoryId = DocumentCategoryId,
DocumentTypeId = DocumentTypeId
};
await _documentAppService.CreateOrEdit(createDocumentDto);
// Get the created or edited document's id
var documentId = createDocumentDto.Id.Value;
return RedirectToAction("Index");
}
No I did not solve the problem. Did you mean if I accidentally closed the "incident"? No i dit not.
Hello, yes I did. In fact i am able to create MAUI applications.
Hello, I get these two errors even with fresh downloads:
Severity Code Description Project File Line Suppression State Error CS0103 The name 'abpHttpClientFactory' does not exist in the current context DocuPro.Mobile.MAUI C:\Users\hp\OneDrive\Visual Studio Apps 2\DocuProV10\src\DocuPro.Mobile.MAUI\Shared\Layout\MainLayout.razor.cs 122 Active
Severity Code Description Project File Line Suppression State Error CS5001 Program does not contain a static 'Main' method suitable for an entry point DocuPro.Mobile.MAUI C:\Users\hp\OneDrive\Visual Studio Apps 2\DocuProV10\src\DocuPro.Mobile.MAUI\CSC 1 Active
Hi, sorry it was a corrupt npm installation
Hello, I successfully created and run Demo app but on my actual app I am getting an error
[email protected] create-bundles yarn && gulp buildDev
yarn install v1.22.15 [1/4] Resolving packages... success Already up-to-date. Done in 0.75s. Error: EPERM: operation not permitted, open 'C:\Users\xxx.yarnrc'