Yeah I asked him it was working on his machine but not mine 🤔, we checked the same commit.
Hi, I sent it through your email.
Hi,
I did not change the generated client proxy's namespace.
Hi, I tried again just now, it's still showing the same error.
Hi, you can try this:
Install the DevExpress.Xpo.EFCore NuGet package in your project. Create a class that inherits from the DevExpress.Xpo.XpoDbContext base class, this class represents the database context.
public class MyDbContext : XpoDbContext
{
public MyDbContext(DbContextOptions<MyDbContext> options)
: base(options)
{
}
}
Create entity:
[Persistent("MyEntity")]
public class MyEntity : XPLiteObject
{
[Key]
[Persistent("MyId")]
public int MyId { get; set; }
[Persistent("MyProperty")]
public string MyProperty { get; set; }
}
If your model has relationship you can refer to this article: https://docs.devexpress.com/eXpressAppFramework/402958/business-model-design-orm/business-model-design-with-entity-framework-core/relationships-between-entities-in-code-and-ui
Register the dbcontext and XpoDbContextOption in your module and define your custom repository:
public interface IMyEntityRepository: IRepository<MyEntity >
{
Task<List<MyEntity>> GetListAsync(
string filterText = null,
string sorting = null,
int maxResultCount = int.MaxValue,
int skipCount = 0,
CancellationToken cancellationToken = default);
}
public class MyEntityRepository: EfCoreRepository<MyDbContext, MyEntity >, IMyEntityRepository
{
public async Task<List<MyEntity>> GetListAsync(string filterText = null, string sorting = null,
int maxResultCount = int.MaxValue, int skipCount = 0, CancellationToken cancellationToken = default)
{
var query = await GetQueryableAsync();
query = query
.WhereIf(filterText != null, d => d.Name.Contains(filterText))
.OrderBy(string.IsNullOrWhiteSpace(sorting) ? MyEntityConsts.GetDefaultSorting(false) : sorting);
return await query.PageBy(skipCount, maxResultCount).ToListAsync(cancellationToken);
}
}
[DependsOn(typeof(AbpEfCoreModule))]
public class MyModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAbpDbContext<MyDbContext>(options =>
{
options.AddDefaultRepositories();
options.AddRepository<IMyEntityRepository, MyEntityRepository>();
});
}
}
In your application service module you can:
public class MyService : ApplicationService
{
private readonly IMyEntityRepository _myEntityRepository;
public MyService(IMyEntityRepository myEntityRepository)
{
_myEntityRepository = myEntityRepository;
}
public async Task<MyEntity> GetAsync(int id)
{
return await _myEntityRepository.FirstOrDefaultAsync(x => x.MyId == id);
}
}
Hi,
I'm a bit disappointed that we have purchased commercial but could not get a response from support. I think no one is interested in this since XPO is a product of devexpress which I assume a competitor. Hope this ticket will be refunded, I only have few remaining support tickets for commercial license :(.
Hi,
It's been 5 days no response. Just wanted to know if this task was possible if not can I ask refund for this ticket? I'll just do research on my own.
I agree with it loading full of errors. My application is not even opening. Can you respond please?
Hi,
what are your error saying? The performance issue was initially suspected as related to redis server and we're investigating if it was really related to redis server or issue from the code.