Skip to content

Commit

Permalink
Removed nullability on User.Name
Browse files Browse the repository at this point in the history
  • Loading branch information
Arlodotexe committed Mar 16, 2024
1 parent 5e3c3a4 commit 200073a
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/Models/User.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Ipfs;
using System;
using Newtonsoft.Json;
using System.Text.Json.Serialization;

namespace WinAppCommunity.Sdk.Models;

Expand All @@ -20,8 +20,8 @@ public record User : IName
/// <summary>
/// Creates a new instance of <see cref="User"/>.
/// </summary>
[JsonConstructor]
public User(string? name, string markdownAboutMe, ApplicationConnection[] connections, Link[] links, Cid[] projects, Cid[] publishers, bool? forgetMe)
[Newtonsoft.Json.JsonConstructor]
public User(string name, string markdownAboutMe, ApplicationConnection[] connections, Link[] links, Cid[] projects, Cid[] publishers, bool? forgetMe)
{
Name = name;
MarkdownAboutMe = markdownAboutMe;
Expand All @@ -38,7 +38,7 @@ public User(string? name, string markdownAboutMe, ApplicationConnection[] connec
public User()
{
// Initialize properties with default values
Name = null;
Name = string.Empty;
MarkdownAboutMe = string.Empty;
Connections = Array.Empty<ApplicationConnection>();
Links = Array.Empty<Link>();
Expand All @@ -50,7 +50,7 @@ public User()
/// <summary>
/// Creates a new instance of <see cref="User"/>.
/// </summary>
public User(string? name, ApplicationConnection[] connections)
public User(string name, ApplicationConnection[] connections)
{
Name = name;
MarkdownAboutMe = string.Empty;
Expand All @@ -64,13 +64,18 @@ public User(string? name, ApplicationConnection[] connections)
/// <summary>
/// The name of the user.
/// </summary>
public string? Name { get; set; }
public string Name { get; set; }

/// <summary>
/// A summary of the user in markdown syntax.
/// </summary>
public string MarkdownAboutMe { get; set; }

/// <summary>
/// An icon to represent this user.
/// </summary>
public Cid Icon { get; set; }

/// <summary>
/// Represents application connections added by the user.
/// </summary>
Expand Down

0 comments on commit 200073a

Please sign in to comment.