~FallenParadise~
~FallenParadise~
CC#
Created by ~FallenParadise~ on 1/27/2024 in #help
AspNet.Identity with custom user data
Hi. Im making app that will use aspnet identity and marten as event store. How i can move all custom data to another class? And how to keep changes in sync? for example if UserData in sync with UserIdentity? for example when user changes email
1 replies
CC#
Created by ~FallenParadise~ on 1/7/2024 in #help
AspNetCore.Identity with EventSourcing
Hi. Im trying to make identity based on events. For that im using Marten. Now im looking on how to impliment em. For now im trying to override store layer of identity. Also it seems that event if i can somehow achive it and extract events from TUser (when user updated) i can't use events for updating. Because there is passed reference to Update method and then i need somehow to pipe that events from model (or parse em and try to figure out what happens?) and then using reflection reasign all properties. EFCore and other things can do it automatically. Should i keep overriding at store layer or go higher to manager layer? Any ideas or examples of event sourcing with identity?
2 replies
CC#
Created by ~FallenParadise~ on 8/14/2023 in #help
❔ DocFX multiproject headers
how to made nested header for docfx? I mean its always show root toc.yml while i want to display nested toc's (bc i have multiple projects inside)
2 replies
CC#
Created by ~FallenParadise~ on 12/25/2022 in #help
❔ NLua csharp hooks
Hi. Im using NLua to embed Lua in my project. Rn i can replace default print method to use hooked console. How i can do same but for require method? in example it dosen't works
var script = """

require "chunk";

testPrint("hello world")
print('test');

""";

var chunk = """
function testPrint(arg)
print(arg .. "hook 2");
end
""";


var luaEngine = new NLua.Lua(true);
luaEngine.State.Encoding = Encoding.UTF8;

luaEngine.RegisterFunction("print", PrintHook<object>);
luaEngine.RegisterFunction("require", RequireHook);

try
{
var result = luaEngine.DoString(script, "Main.lua");
}
catch (Exception ex)
{
Console.WriteLine(ex);
}

static void PrintHook<T>(T text)
{
Console.WriteLine($"Hooked {text}");
}

LuaStatus RequireHook(string chunkName)
{
try
{
Console.WriteLine($"Hooked {chunkName}");
// not works
//return luaEngine.State.LoadString(chunk);
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
// fallback
return LuaStatus.OK;
}
var script = """

require "chunk";

testPrint("hello world")
print('test');

""";

var chunk = """
function testPrint(arg)
print(arg .. "hook 2");
end
""";


var luaEngine = new NLua.Lua(true);
luaEngine.State.Encoding = Encoding.UTF8;

luaEngine.RegisterFunction("print", PrintHook<object>);
luaEngine.RegisterFunction("require", RequireHook);

try
{
var result = luaEngine.DoString(script, "Main.lua");
}
catch (Exception ex)
{
Console.WriteLine(ex);
}

static void PrintHook<T>(T text)
{
Console.WriteLine($"Hooked {text}");
}

LuaStatus RequireHook(string chunkName)
{
try
{
Console.WriteLine($"Hooked {chunkName}");
// not works
//return luaEngine.State.LoadString(chunk);
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
// fallback
return LuaStatus.OK;
}
3 replies
CC#
Created by ~FallenParadise~ on 9/18/2022 in #help
Mapster EqualityComparison
Hi. How i can pass self reference to nested method of mapping?
21 replies
CC#
Created by ~FallenParadise~ on 9/16/2022 in #help
Ef core value comparer
Ef hate my value comparer
17 replies