felsokning
felsokning
CC#
Created by felsokning on 1/30/2025 in #help
Populate `EnvelopeRecipientCollection` on `Recipients` Property of a `MailItem` in Transport Agent
I'm not testing classes from the external libraries but my own logic in the EndOfDataEventHandler delegate. Part of that logic is quarantining a message via ReceiveMessageEventSource.Quarantine, which requires an IEnumerable<EnvelopeRecipient> to be passed in. The only way I can derive that list is from the EnvelopeRecipientCollection from the MailItem, I believe. https://learn.microsoft.com/en-us/previous-versions/office/exchange-server-api/aa567154(v=exchg.150) https://learn.microsoft.com/en-us/previous-versions/office/exchange-server-api/aa564601(v=exchg.150)
14 replies
CC#
Created by felsokning on 1/30/2025 in #help
Populate `EnvelopeRecipientCollection` on `Recipients` Property of a `MailItem` in Transport Agent
Gives the error about being different types: Argument 1: cannot convert from 'System.Collections.Generic.List<Microsoft.Exchange.Data.Transport.EnvelopeRecipient>.Enumerator' to 'Microsoft.Exchange.Data.Transport.EnvelopeRecipientCollection.Enumerator'
14 replies
CC#
Created by felsokning on 1/30/2025 in #help
Populate `EnvelopeRecipientCollection` on `Recipients` Property of a `MailItem` in Transport Agent
Sorry, forgot: SetPropertyValue is just a reflection extension.
[ExcludeFromCodeCoverage]
public static class Reflection
{
private static PropertyInfo GetPropertyInfo(Type type, string propertyName)
{
PropertyInfo propInfo = null;
do
{
propInfo = type.GetProperty(propertyName,
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
type = type.BaseType;
}
while (propInfo == null && type != null);
return propInfo;
}

public static void SetPropertyValue(this object obj, string propertyName, object val)
{
if (obj == null)
throw new ArgumentNullException("obj");
Type objType = obj.GetType();
PropertyInfo propInfo = GetPropertyInfo(objType, propertyName);
if (propInfo == null)
throw new ArgumentOutOfRangeException("propertyName",
string.Format("Couldn't find property {0} in type {1}", propertyName, objType.FullName));
propInfo.SetValue(obj, val, null);
}
}
[ExcludeFromCodeCoverage]
public static class Reflection
{
private static PropertyInfo GetPropertyInfo(Type type, string propertyName)
{
PropertyInfo propInfo = null;
do
{
propInfo = type.GetProperty(propertyName,
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
type = type.BaseType;
}
while (propInfo == null && type != null);
return propInfo;
}

public static void SetPropertyValue(this object obj, string propertyName, object val)
{
if (obj == null)
throw new ArgumentNullException("obj");
Type objType = obj.GetType();
PropertyInfo propInfo = GetPropertyInfo(objType, propertyName);
if (propInfo == null)
throw new ArgumentOutOfRangeException("propertyName",
string.Format("Couldn't find property {0} in type {1}", propertyName, objType.FullName));
propInfo.SetValue(obj, val, null);
}
}
`
14 replies
CC#
Created by felsokning on 1/30/2025 in #help
Populate `EnvelopeRecipientCollection` on `Recipients` Property of a `MailItem` in Transport Agent
And here's the deconstructed view of EnvelopeRecipientCollection.
14 replies
CC#
Created by felsokning on 1/30/2025 in #help
Populate `EnvelopeRecipientCollection` on `Recipients` Property of a `MailItem` in Transport Agent
This is the deconstructed view of the MailItem. As you can see, it only has a get for the Recipients property and the constructor is marked as internal. When Recipients is populated, I have to assume it's on the EndOfHeaders process in the Transport Pipeline, itself?
14 replies
CC#
Created by felsokning on 1/30/2025 in #help
Populate `EnvelopeRecipientCollection` on `Recipients` Property of a `MailItem` in Transport Agent
The helper to translate the email to an email item also came from there.
14 replies
CC#
Created by felsokning on 1/30/2025 in #help
Populate `EnvelopeRecipientCollection` on `Recipients` Property of a `MailItem` in Transport Agent
14 replies
CC#
Created by LastExceed on 1/28/2025 in #help
how do i generate WCF connected services on build/restore?
It's been a long time since I messed with WCF -- but there used to be a means to have the connections autogenerated but I don't remember how it was done. This is my autogenerated service connector: https://github.com/felsokning/Tomte/blob/master/Fels%C3%B6kning.Tomte/Fels%C3%B6kning.Tomte.PowerShell/WorkflowService.cs So, I know that it can be done - but I'm genuinely sorry that I can't remember how it was done. ☹️
3 replies
CC#
Created by morry329# on 1/30/2025 in #help
✅ NullPointException in the Update/Post method, but not in the Get Method
In the GET, you're using _context but in your post, you're using _listingProjectsDtoRepository. If you debug it, is _listingProjectsDtoRepository null? I'm not sure why you're using both _context and _listingProjectsDtoRepository. Then you update it using _context? _context.ListingDTO_DBTable.Update(_listingProjectsDto); If I had to guess, without seeing the rest of your code, your DI isn't DI'ing - that's why. Also, why are you injecting an HttpClient, if you're not making any http calls? As everyone else said, above, there's a lot of this code that needs clean-up/fixing.
46 replies
CC#
Created by divine_beast on 11/4/2024 in #help
azure sql and cosmos db access testing using dotnet
...or Azure Data Studio
5 replies
CC#
Created by divine_beast on 11/4/2024 in #help
azure sql and cosmos db access testing using dotnet
Why not try with SSMS (SQL Server Management Studio)?
5 replies
CC#
Created by ! skyxjs on 11/3/2024 in #help
Build single executable
...but as @Pobiega said, .NET framework won't work well and/or publish as a single file on any platform, I think.
25 replies
CC#
Created by ! skyxjs on 11/3/2024 in #help
Build single executable
<RuntimeIdentifier>RID</RuntimeIdentifier> -- Needs to be the actual RID value.
25 replies
CC#
Created by Dongle on 11/3/2024 in #help
(SOLVED) dotnet publish complains about missing Emscripten
Don't forget to mark it as solved! 😃
4 replies
CC#
Created by Jabka on 11/3/2024 in #help
Help. Broken Rust plugin
You're - literally - going to have to reverse-engineer what was done in BasePlayer class, to understand the required overloads. See here: https://oxidemod.org/threads/where-is-the-baseplayer-class.22597/
15 replies
CC#
Created by occluder on 11/3/2024 in #help
✅ Trouble porting to AOT JSON
Even then, you can do something like GoogleUser: User and AADUser: User and OtherProvider: User. Which makes User extensible and the target type derived from that. So, if you want to change DisplayName, for example, you just have to change it in User, once, not 50 different User classes.
49 replies
CC#
Created by occluder on 11/3/2024 in #help
✅ Trouble porting to AOT JSON
If you have 1 User class with properties that get populated per domain type, those null/empties can be ignored; you can project one to many, instead of having to have 1:1. Unless you're projecting the User back to the client, the client doesn't care how you process User.
49 replies
CC#
Created by occluder on 11/3/2024 in #help
✅ Trouble porting to AOT JSON
49 replies
CC#
Created by occluder on 11/3/2024 in #help
✅ Trouble porting to AOT JSON
I think, without being able to see the code, it's resolving as multiple types; so it's resolving as A and B or A and C. If you want do it based on specific properties, you can, but I've never done it - so I can't expound upon it, further. https://learn.microsoft.com/en-us/dotnet/standard/serialization/system-text-json/polymorphism?pivots=dotnet-8-0#configure-polymorphism-with-the-contract-model
49 replies