Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8411919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:32:48+00:00 2026-06-10T00:32:48+00:00

Here is my serializable abstract class namespace NEN_FS { [Serializable()] abstract public class NFS

  • 0

Here is my serializable abstract class

namespace NEN_FS {
    [Serializable()]
    abstract public class NFS : IEquatable<NFS> {
        abstract public string Path { get; set; }
        public NFS() {
            Path = "";
            }
        public NFS(string path) {
            Path = path;
            }
        public override bool Equals(object obj) {
            NFS other = obj as NFS;
            return (other != null) && ((IEquatable<NFS>)this).Equals(other);
            }
        bool IEquatable<NFS>.Equals(NFS other) {
            return Path.Equals(other.Path);
            }
        public override int GetHashCode() {
            return Path != null ? Path.GetHashCode() : base.GetHashCode();
            }
        }
    }

What I have in F#: let file = files.[0]. and there is no Path field.

Why is that? How can I access Path property?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:32:49+00:00Added an answer on June 10, 2026 at 12:32 am

    Huh? Strange.. maybe some bug in meta-data reading or intellisense. Try writing file.[0].Path and compiling. Sometimes the Intellisense skips something but the compiler sees whole structure right and compiles without complaints.

    If not working – then maybe F# doesn’t like abstract for some reasons unknown to me (i.e. some overall nonsense like im-possibility of instantiating an ‘example object’).. I’m not fluent in F# yet, but thinking about .Net itself, have you tried to define and use an interface instead of abstract base? I mean:

    namespace NEN_FS {
        public interface class INFS : IEquatable<NFS>
        {
            string Path { get; set; }
        }
    
        [Serializable()]
        abstract public class NFS : INFS {
            abstract public string Path { get; set; }
            public NFS() {
                Path = "";
                }
            public NFS(string path) {
                Path = path;
                }
            public override bool Equals(object obj) {
                NFS other = obj as NFS;
                return (other != null) && ((IEquatable<NFS>)this).Equals(other);
                }
            bool IEquatable<NFS>.Equals(NFS other) {
                return Path.Equals(other.Path);
                }
            public override int GetHashCode() {
                return Path != null ? Path.GetHashCode() : base.GetHashCode();
                }
            }
    

    And then expose IEnumerable<INFS> Files instead of IEnumerable<NFS> Files. That way it just have to work, because interfaces are the core of access to many things..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's my code: [Serializable()] public class Project { private List<string> _Kinds = new List<string>();
Here's the code I'm using: public class Ser implements Serializable { int x,y; String
Here's my class: [Serializable()] [XmlRootAttribute(Language)] public class Language : ISerializable { string Id {
here's the code (simplified): public abstract class PageBase implements Serializable { private static final
I have an Abstract class: [Serializable] public abstract class BaseModel { public virtual int
I'm trying to maintain a dictionary of configurations. Here is my abstract class. [Serializable]
Here is my object [Serializable()] public class PersistentObject { public virtual int ID {
I created a wrapper to extend an ObservableCollection<T> [Serializable] public abstract class ModelCollection<TModel> :
I would like to use a base message class like: [Serializable] public abstract class
Here's the class im trying to store [Serializable] [XmlRoot(ElementName = Database, IsNullable = false,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.