Lisa
Lisa
CC#
Created by Lisa on 6/28/2024 in #help
✅ Unable to create migration - 'Unable to resolve service for type 'DbContextOptions'
Created a context factory, seems to work fine now:
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;

namespace Treehouse_Guardian.Database;

public class DatabaseContextFactory : IDesignTimeDbContextFactory<DatabaseContext>
{
public DatabaseContext CreateDbContext(string[] args)
{
var configuration = new ConfigurationManager()
.AddJsonFile("appsettings.json", false)
.Build();

var optionsBuilder = new DbContextOptionsBuilder<DatabaseContext>();
optionsBuilder.UseNpgsql(configuration["Postgres:ConnectionString"]);

return new DatabaseContext(optionsBuilder.Options);
}
}
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using Microsoft.Extensions.Configuration;

namespace Treehouse_Guardian.Database;

public class DatabaseContextFactory : IDesignTimeDbContextFactory<DatabaseContext>
{
public DatabaseContext CreateDbContext(string[] args)
{
var configuration = new ConfigurationManager()
.AddJsonFile("appsettings.json", false)
.Build();

var optionsBuilder = new DbContextOptionsBuilder<DatabaseContext>();
optionsBuilder.UseNpgsql(configuration["Postgres:ConnectionString"]);

return new DatabaseContext(optionsBuilder.Options);
}
}
2 replies
CC#
Created by harelc2005 on 5/12/2024 in #help
✅ Help with a project
Have you tried looking at libraries instead of apis? You can easily get the notes out with something like https://github.com/melanchall/drywetmidi
11 replies
CC#
Created by Letieri on 5/8/2024 in #help
Issue with unit test for Argon2-based password hash service
As you can see the salt is included in plaintext in the encoded string.
25 replies
CC#
Created by Letieri on 5/8/2024 in #help
Issue with unit test for Argon2-based password hash service
No description
25 replies
CC#
Created by Letieri on 5/8/2024 in #help
Issue with unit test for Argon2-based password hash service
This is because you are using argon2Config.EncodeString EncodeString includes information about how the hash was computed, including the salt. In this case the provided salt is ignored and the salt from the hashstring is used.
25 replies
CC#
Created by Letieri on 4/23/2024 in #help
Argon2
What makes you say so? I do not think your conclusion is correct.
11 replies
CC#
Created by zakatinhio on 4/26/2024 in #help
✅ ‘Step Test Data’
So, what's your question?
16 replies
CC#
Created by Haxo on 4/25/2024 in #help
How to Read byte by byte until EOF?
It depends on the filemode
19 replies
CC#
Created by Haxo on 4/25/2024 in #help
How to Read byte by byte until EOF?
:nodd:
19 replies
CC#
Created by Kamil Pisz on 4/25/2024 in #help
Search in database for more then one column (EFCore, Postgresql)
and then you can chain on whatever else you want to do, eg location.
4 replies
CC#
Created by Kamil Pisz on 4/25/2024 in #help
Search in database for more then one column (EFCore, Postgresql)
.Where(e => IsMatchingEmployee(e, searchTerm))
4 replies
CC#
Created by Haxo on 4/25/2024 in #help
How to Read byte by byte until EOF?
FileAccess is about the operations you want to do on that file
19 replies
CC#
Created by Haxo on 4/25/2024 in #help
How to Read byte by byte until EOF?
FileMode is about how the operating system should open the file. Open it, create a new one and open it, add to an existing file.
19 replies
CC#
Created by Kamil Pisz on 4/25/2024 in #help
Search in database for more then one column (EFCore, Postgresql)
what's stopping you from just making your own search function? Take in the record and the search term, feed it into a function, return true or false wether it matches.
4 replies
CC#
Created by Haxo on 4/25/2024 in #help
How to Read byte by byte until EOF?
19 replies
CC#
Created by Letieri on 4/23/2024 in #help
Argon2
11 replies
CC#
Created by Letieri on 4/23/2024 in #help
Argon2
Imo I'd opt for a more complete and up to date library that handles most of the easy trip-ups for you
11 replies
CC#
Created by Letieri on 4/23/2024 in #help
Argon2
You need to use SequenceEqual, not Equals. Equals for a byte array will only check if they are the same instance, not if they contain the same elements.
11 replies
CC#
Created by おやすみ on 4/19/2024 in #help
Any way to inherit base abstract class' constructor?
I obviously don't have the entire code context here, but: My intuition says instructions could be an interface and you could pass dependencies from method arguments.
20 replies
CC#
Created by おやすみ on 4/19/2024 in #help
Any way to inherit base abstract class' constructor?
If they don't need any modifications.
20 replies