« first day (3796 days earlier)      last day (1135 days later) » 

4:54 AM
@mr5 what I meant was, using C#. I have the following model:
class User : IdentityUser
{
    public int Id { get; set; }
    public string Name { get; set; }
    public <ImageClass(this is what I am asking)> License { get; set; }
}
 
[kesarling] @markiel, sorry to disturb you then 🙂 But I kind of did something entirely different. I am storing the images in CDN and storing the url in the model instead. Does that seem like a good idea?
 
 
1 hour later…
5:57 AM
Is it a good idea to create ViewModel classes in MVC?
 
@mr5 I have this, set with keyboard. Rarely used...
 
 
1 hour later…
7:03 AM
Good morning Fam <3
@d4rk4ng31 Sure, why not?
 
[Jack sparrow] Has any one mocked prism's NavigationContext?
 
@MohammadYusuf
Hi
 
[Jack sparrow] there's a weird behavior with NavigationContext, I'm trying to initialize data to it, but it just does init the NavigationParameter.
[Jack sparrow] the navContext's navigationParameter count is still 0
[Squirrel in Training] GoOoOoOoOoOoOoOoOoOoOoOd Mornin' neglecterinos!
[Jack sparrow] Good morning
 
 
5 hours later…
12:06 PM
where can I learn about c# project architecture?
services and all?
 
12:37 PM
 
12:57 PM
"[object Promise]"
probably the last thing you want to see on the website of your bank
perhaps only beaten by a sequence of zeros
 
@Wietlol sequence of numbers. Lots of numbers. With a negative sign before it.
 
1:37 PM
Hi all, I've got a design issue I'm struggling with and would appreciate some help.
Let's say I have a class called Transition which implements ITransition interface
ITransition interface has a method: AddConditions(params Condition[] conditions)
Condition is a delegate which looks like this: delegate bool Condition(IContext context)
Now there are two IContext interfaces, IContext and IContext<T> and IContext<T> inherits IContext

However since the signature of Condition delegate takes the non-generic IContext I cannot pass conditions like: (IContext<SomeType> ctx) => return true;
 
would like to check if there's any symbols inbetween numbers using regex
$156.00 is allowed, $156-.00 or $15*.00 are not allowed
 
mr5
1:54 PM
@MrPlow overload AddConditions
@d4rk4ng31 yeah that's common thing to do.
@nyconing what mouse do you use then?
This one is kinda comfy compared to my previous
 
@d4rk4ng31 That's the only way I do MVC now. I don't pass the model into the view.
 
mr5
Although I wish I just bought a magic mouse for Windows
 
@mr5 Let's say that Transition holds a List of conditions. How would that work if I had two AddConditions where one adds a Condition(IContext) and another one adds a Condition<T>(IContext<T>) ?
 
mr5
or maybe create a common interface for the non-generic and generic IContext?
and replace the signature of the AddConditions with that new interface
 
2:13 PM
@mr5 that wouldn't really work as the purpose of non-generic IContext was so that it can be used in places where the type isn't known or necessary to be known, but IContext<T> contains additional typed parameters which are often-times needed in the Conditions. I'd like to slot-in a Condition with a generic IContext<T> and non-generic IContextinto the same collection
 
mr5
oh
time for hack then. what I did when I encounter a similar problem is to create a private object and convert it later to the object I want.
using a bit of reflection if you're ok with that
this is the one I'm referring: link
 
2:54 PM
@Sakthivel wouldnt it be easier to check if your number is just an acceptable one?
^\$\d+(?:\.\d+)?$
@MrPlow you probably need to re-validate your design choice then
the way you describe it, is a hard violation of LSP
adding IContext<T> instances to an IList<IContext> should be perfectly fine
 
@Wietlol That it does, but what if instead of having a list of Context I have a list of Condition delegates which can take either a IContextor IContext<T> as input?
 
depends
in theory, if your parameter type would be IContext<T>, then using IContext as parameter should be allowed
but C# is really bad at generics, so it will still yell at you
but you can get around that
the easiest way to get the typed parameter would be to also provide the type to the transition class
which would mean:
delegate Boolean Condition<in T>(IContext<T> context);
public interface ITransition<out T>
also...
public interface IContext<out T> : IContext
the ins and outs would help a lot eventually
 
 
1 hour later…
4:22 PM
Ryan Donovan on March 08, 2021
IaC allows developers to supply IT environments with multiple lines of code and can be deployed in a matter of minutes (in contrast to manual infrastructure, which can take hours if not days to be deployed).
 
 
3 hours later…
7:13 PM
Given a `Dictionary<Type, Component> components` where components are added as `AddComponent<T>(T component) : where T : Component => components[typeof(T)] = component;`

How could I write a `GetComponent<T>()` which would work for both exact and base types. Something like

`class TestComponent : Component, IInterface`
`entity.AddComponent(new TestComponent())`
`var testComponent = entity.GetComponent<TestComponent>()`
`var testInterface = entity.GetComponent<IInterface>()`
 
7:41 PM
Sounds do-able
 
I've got this... but I'm wondering if there's a better way
    public T GetComponent<T>()
        {
            T component = components.TryGetValue(typeof(T), out object value) ? (T)value : default;

            if (!EqualityComparer<T>.Default.Equals(component, default))
            {
                return component;
            }

            foreach(Type type in components.Keys)
            {
                if (typeof(T).IsAssignableFrom(type))
                {
                    return (T)components[type];
                }
            }

            return default;
 
the equality comparer stuff could be as simple as component != default
the foreach might be better to loop over the pairs rather than the keys
although, this might just be a very good XY case
perhaps a service container/provider is what you are looking for
 
 
2 hours later…
9:30 PM
Using a HTTPClient and how the heck do you view the request when sending PostAsJsonAsync
 
which side? You want to see the half sent message, or the arrived request?
 
10:01 PM
Hi
i have a question
What is replacement for SqlTableDependency in mysql?
 
10:20 PM
I'd use profiling
but subscribe to every kind of changes? That's sounds heavy overhead
 
@ntohl the request? so the Sent message
Want to see if the object is in the request
It's not getting to the Controller Method
 
10:54 PM
0
Q: How to check some data has changed in the MySQL database from c# application

Hamreen AhmadI have created a POS system to a market the market have a number of PCs and a server. I have created the application successfully and I have not problem when the application is used only in one PC but what I do if the application is needed to be installed on a number of PCs just like the followin...

 
11:16 PM
[Not Li] <:Thunk:589548199023345688>
 

« first day (3796 days earlier)      last day (1135 days later) »