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 810967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:58:07+00:00 2026-05-15T00:58:07+00:00

I have the following function public Dictionary<DateTime, object> GetAttributeList( EnumFactorType attributeType, Thomson.Financial.Vestek.Util.DateRange dateRange) {

  • 0

I have the following function

public Dictionary<DateTime, object> GetAttributeList(
    EnumFactorType attributeType,
    Thomson.Financial.Vestek.Util.DateRange dateRange)
{
    DateTime startDate = dateRange.StartDate;
    DateTime endDate = dateRange.EndDate;            

    return (
        //Step 1: Iterate over the attribute list and filter the records by 
        // the supplied attribute type 
        from assetAttribute in AttributeCollection
        where assetAttribute.AttributeType.Equals(attributeType)

        //Step2:Assign the TimeSeriesData collection into a temporary variable  
        let timeSeriesList = assetAttribute.TimeSeriesData

        //Step 3: Iterate over the TimeSeriesData list and filter the records by 
        // the supplied date  
        from timeSeries in timeSeriesList.ToList()
        where timeSeries.Key >= startDate && timeSeries.Key <= endDate

        //Finally build the needed collection 
        select timeSeries);
}

Error:Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<System.Collections.Generic.Dictionary<System.DateTime,object>>'
to 'System.Collections.Generic.Dictionary<System.DateTime,object>'.
An explicit conversion exists (are you missing a cast?)

Using C# 3.0

  • 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-05-15T00:58:08+00:00Added an answer on May 15, 2026 at 12:58 am

    It’s difficult to know what you really want without more information on your structures. What should the return object be – the asset attribute or the time series? If it’s the attribute then something like this should work

    //Finally build the needed  collection 
    select new {timeSeries.Key, assetAttribute})
        .ToDictionary(t => t.Key, t => (object)t.assetAttribute);
    

    or if it’s just the time series then

    //Finally build the needed  collection 
    select timeSeries).ToDictionary(t => t.Key, t => (object)t);
    

    I’m not a LINQ guru so there may be better ways to do this but these ought to compile at least.

    [edit] just spotted your function name: I guess you want the first one then.

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

Sidebar

Related Questions

I have the following function: public static T TryGetArrayValue<T>(object[] array_, int index_) { ...
I have created the following function: public void DelegatedCall(Action<Object> delegatedMethod) And defined the following
I have the following function: public static byte[] StringToByte(string str) { int length =
I have the following function below: public function setupHead($title){ $displayHead .='<!DOCTYPE html PUBLIC -//W3C//DTD
I have following function in one Activity public void AppExit() { Editor edit =
I have following repository: public function findClassPhotoByPath($path) { return $this->getEntityManager() ->createQuery('SELECT p FROM KSRGalleryBundle:Photo
I have the following higher-order function: public static Func<T, bool> Not<T>(Func<T, bool> otherFunc) {
I have the following function for SQLite select statement public Boolean itemFound(String cartId,Long ItemId){
I have the following function which sets up the GUI. public void go() {
I have the following Symfony2 form: public function buildForm(FormBuilder $builder, array $options) { $builder

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.