Error..does not implement inherited abstract member

Error..does not implement inherited abstract member

Old forum URL: forums.lhotka.net/forums/t/6191.aspx


oneinone posted on Sunday, January 18, 2009

hi,
im getting error like dis..
  'ClassLibrary1.Library.Customer' does not implement inherited abstract member 'Csla.BusinessBase<ClassLibrary1.Library.Customer>.GetIdValue()'   

how can i fix this error..,

I have implemented code like this

using System;
using System.Collections.Generic;
using System.Text;
using Csla;
using Csla.Data;

namespace ClassLibrary1.Library
{
    [Serializable()]
    public class Customer : BusinessBase<Customer>
    {
        #region Business Methods

        private string _firstname = string.Empty;
        private string _lastname = string.Empty;
        private string _description = string.Empty;

        public string FirstName
        {
            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
            get
            {
                CanReadProperty(true);
                return _firstname;
            }
            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
            set
            {
                CanWriteProperty(true);
                if (value == null) value = string.Empty;
                if (value != null)
                {
                    _firstname = value;
                    PropertyHasChanged();
                }
            }
        }
        public string LastName
        {
            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
            get
            {
                CanReadProperty(true);
                return _lastname;
            }
            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
            set
            {
                CanWriteProperty(true);
                if (value == null) value = string.Empty;
                if (value != null)
                {
                    _lastname = value;
                    PropertyHasChanged();
                }
            }
        }
        public string Description
        {
            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
            get
            {
                CanReadProperty(true);
                return _description;
            }
            [System.Runtime.CompilerServices.MethodImpl(System.Runtime.CompilerServices.MethodImplOptions.NoInlining)]
            set
            {
                CanWriteProperty(true);
                if (value == null) value = string.Empty;
                if (value != null)
                {
                    _description = value;
                    PropertyHasChanged();
                }
            }
        }
        #endregion

RockfordLhotka replied on Monday, January 19, 2009

You have two choices.

Either override GetIdValue() - which is what the compiler is telling you to do.

or

Upgrade to CSLA .NET 3.5 or higher, where GetIdValue() isn't required or used.

Copyright (c) Marimer LLC