BekirK
BekirK
CC#
Created by BekirK on 4/16/2024 in #help
Run multiple test projects in parallel
No description
2 replies
CC#
Created by BekirK on 1/22/2024 in #help
✅ How to set enum default int value
Hi everyone, I have an enum type. For example as below. Normally, the value of enums in the db starts from 0. I know that if we want to start from 1, saying '=1' for the first value is enough. The question I want to ask you about is that you can do this process automatically with typeconfiguration etc. Can I do it somewhere? The reason I want this is because I have many enums. And I want them all to start from 1. What do you think about it :)
public enum MyEnum
{
FValue,
SValue,
TValue
}
public enum MyEnum
{
FValue,
SValue,
TValue
}
40 replies
CC#
Created by BekirK on 1/11/2024 in #help
OData filtering
Hi everyone, I want to ask you something about OData, I have roles for a user. And I separate these roles with ",". For example, there are roles such as; user_1: "test_1, test_2" user_2: "test_1" user_2: "test_2, test_4" I use OData when listing these roles. There is a filtering process on the FE side. However, since there is more than one role separated by commas, it gives the following error: objA: (object)EF.Property<Guid?>(u, "Id"), \r\n objB: (object)EF.Property<Guid?>(u0, "UserId")))\r\n . Any() ? string.Join(\r\n separator: ",", \r\n values: DbSet<UserRole>()\r\n .Where(u1 => !(u1.IsDeleted))\r\n .Where( u1 => EF.Property<Guid?>(u, "Id") != null && object.Equals(\r\n ) How do you think I can do the filtering? When I filter as "test_2" I want user_1 and user_2 to appear.
3 replies
CC#
Created by BekirK on 1/8/2024 in #help
On the ValueGeneratedNever() method
No description
2 replies
CC#
Created by BekirK on 1/6/2024 in #help
✅ double the number of tests in Rider after upgraded to .net 7
No description
32 replies
CC#
Created by BekirK on 12/11/2023 in #help
OData filtering string variable
No description
4 replies
CC#
Created by BekirK on 11/11/2023 in #help
✅ VS "cs1525 invalid expression term '{' " error when I change a variable value in debug mode
No description
9 replies
CC#
Created by BekirK on 11/3/2023 in #help
❔ Can Visual Studio potential fixes suggest nuget packages?
Hello, if you've used ReSharper in Visual Studio or Rider, you might be familiar with the feature where it suggests downloading the relevant NuGet package if you're using code from an uninstalled NuGet package. I'm wondering can I do this through settings or with an light extension(not ReSharper, cus it's heavy) in Visual Studio?
33 replies
CC#
Created by BekirK on 6/24/2023 in #help
❔ Getting the connectionString from appsetting.json
Hello everyone, in my project I am using a Generic build like this: public class EfGenericRepository<TEntity, TContext> : IGenericRepository<TEntity> where TEntity : class, IEntity, new() where TContext : DbContext, new() { public void Add(TEntity entity) { using (TContext context = new TContext()) { var addedEntity = context.Entry(entity); addedEntity.State = EntityState.Added; context.SaveChanges(); } } } Any EntityDal class is like this: public class EfCategoryDal : EfGenericRepository<Category, SimpraProjectContext>, ICategoryDal { } Context class is like this public class SimpraProjectContext : DbContext { protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) { optionsBuilder.UseSqlServer(@"Server=DESKTOP-xxx; Database=TestOne; Trusted_Connection=true; TrustServerCertificate=True"); } // other codes } I couldn't perform the necessary operations to get the connectionString from appsetting.json. Can you help with this. (I'm using .net 6)
21 replies
CC#
Created by BekirK on 6/15/2023 in #help
✅ Authorize() Attribute is not working (SOLVED)
6 replies
CC#
Created by BekirK on 6/8/2023 in #help
✅ Dapper Generic Repository Error in Insert Method (SOLVED)
10 replies
CC#
Created by BekirK on 3/13/2023 in #help
✅ About ModelState in MVC
47 replies